ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
573 stars 170 forks source link

[Bug]: Attribute is derived subtype. #863

Open RyugaRyuzaki opened 3 weeks ago

RyugaRyuzaki commented 3 weeks ago

What happened?

When i try to create IfcGeometricRepresentationSubContext :

this.IfcGeometricRepresentationSubContext1 =
      new IFC4X3.IfcGeometricRepresentationSubContext(
        new IFC.IfcLabel("Axis"),
        new IFC.IfcLabel("Model"),
        this.IfcAxis2PlacementGlobal3D,
        this.IfcGeometricRepresentationContext,
        new IFC.IfcPositiveRatioMeasure(1e-3),
        IFC.IfcGeometricProjectionEnum.GRAPH_VIEW,
        new IFC.IfcLabel("")
      );

Then i checked from here https://validate.buildingsmart.org/dashboard It threw this error image

Version

0.0.54

What browsers are you seeing the problem on?

No response

Relevant log output

null

Anything else?

null

RyugaRyuzaki commented 2 weeks ago

From snippet :

constructor IFC4X3.IfcSIUnit(
Dimensions: (Handle<IFC.IfcDimensionalExponents> | IFC.IfcDimensionalExponents),
 UnitType: IFC.IfcUnitEnum, 
Prefix: IFC.IfcSIPrefix | null, 
Name: IFC.IfcSIUnitName): IFC.IfcSIUnit

So i follow

 IfcDimensionalExponents: IFC.IfcDimensionalExponents =
    new IFC.IfcDimensionalExponents(1, 1, 1, 1, 1, 1, 1);
  IfcLengthUnit: IFC.IfcSIUnit = new IFC.IfcSIUnit(
    this.IfcDimensionalExponents,
    IFC.IfcUnitEnum.LENGTHUNIT,
    "",
    IFC.IfcSIUnitName.METRE
  );

And result

#19= IFCSIUNIT(#18,.LENGTHUNIT.,$,.METRE.);

Expected :

#19= IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);

The problem "*" instead "#18".

beachtom commented 1 week ago

Can you share the full code for writing it?

RyugaRyuzaki commented 1 week ago

Can you share the full code for writing it?

@beachtom to define and to export and to writeline

beachtom commented 1 week ago

This is fixed!

RyugaRyuzaki commented 1 week ago

This is fixed!

Ops! @beachtom it's still error! image Result :

#88=IFCSIUNIT(.LENGTHUNIT.,'',.MILLI.,$);

Expected :

#88=IFCSIUNIT(*,.LENGTHUNIT.,'',.MILLI.,$);
beachtom commented 6 days ago

Did you test with the code here - new version hasn't been released yet? In any case I will double check

RyugaRyuzaki commented 6 days ago

Did you test with the code here - new version hasn't been released yet? In any case I will double check

yes. i downloaded build.zip then i followed this

    class IfcSIUnit extends IfcNamedUnit {
        UnitType: IfcUnitEnum;
        Prefix: IfcSIPrefix | null;
        Name: IfcSIUnitName;
        type: number;
        constructor(UnitType: IfcUnitEnum, Prefix: IfcSIPrefix | null, Name: IfcSIUnitName);
    }

And output

#88=IFCSIUNIT(.LENGTHUNIT.,'',.MILLI.,$);