[Bug]: Attribute is derived subtype.
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
Version
0.0.54
What browsers are you seeing the problem on?
No response
Relevant log output
null
Anything else?
null
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".
Can you share the full code for writing it?
This is fixed!
This is fixed!
Ops! @beachtom it's still error!
Result :
#88=IFCSIUNIT(.LENGTHUNIT.,'',.MILLI.,$);
Expected :
#88=IFCSIUNIT(*,.LENGTHUNIT.,'',.MILLI.,$);
Did you test with the code here - new version hasn't been released yet? In any case I will double check
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.,$);
I think I may be hitting the same or a similar issue with 0.0.61. In the below code I'm writing a minimal IFC file with just a single instance of IfcSIUnit. It outputs the line #1=IFCSIUNIT(#0,.LENGTHUNIT.,$,.METRE.); rather than the expects #1=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);. My understanding is that the first parameter should be '*' as that is now derived.
Code used to reproduce the issue:
import WebIFC from "web-ifc";
import * as fs from "fs";
const ifcApi = new WebIFC.IfcAPI();
await ifcApi.Init();
const newIfcModel = {
schema: WebIFC.Schemas.IFC4,
name: `Test Project`,
}
const modelId = ifcApi.CreateModel(newIfcModel);
const metres = new WebIFC.IFC4.IfcSIUnit(
WebIFC.IFC4.IfcUnitEnum.LENGTHUNIT,
null,
WebIFC.IFC4.IfcSIUnitName.METRE
);
ifcApi.WriteLine(
modelId,
metres,
);
fs.writeFileSync('test.ifc', ifcApi.SaveModel(modelId));
ifcApi.CloseModel(modelId);
Output:
ISO-10303-21;
HEADER;
/******************************************************
* STEP Physical File produced by: That Open Engine WebIfc 0.0.61
* Module: web-ifc/IfcLoader
* Version: 0.0.61
* Source: https://github.com/ThatOpen/engine_web-ifc
* Issues: https://github.com/ThatOpen/engine_web-ifc/issues
******************************************************/
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('Test Project','2024-11-11T10:58:51',($),($),'thatopen/web-ifc-api','thatopen/web-ifc-api',$);
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCSIUNIT(#0,.LENGTHUNIT.,$,.METRE.);
ENDSEC;
END-ISO-10303-21;
This has resolved the bug for me.