Closed pegreal closed 5 months ago
About the error on showing the Properties, I am not sure, but I think that:
On https://github.com/IFCjs/components/blob/main/src/ifc/IfcPropertiesUtils/index.ts:
static getEntityName(properties: IfcProperties, entityID: number) {
const entity = properties[entityID];
const key = Object.keys(entity).find((key) => key.endsWith("Name")) ?? null;
const name = key ? (entity[key].value as string) : null;
return { key, name };
}
About the error that the properties are not shown, I am not completely sure, but I think that depending on the program that generates the IFC file, it does not generate the value attribute, if it is null, in the case of IfcRelDefinesByProperties, and I do not know if the same happens with the IfcPropertySingleValue. So it will generate the error at this point, I think it would be necessary to validate that the value attribute exists.
In the example file that I attached in the issue, it is an IFC generated by Civil3D, the same thing happens to me with other examples from Civil3D, both the error of the properties, and the problem of the visualisation.
It is an idea... :P
@agviegas Regarding the wrinkled displayed models, several things come to my mind:
Thanks
I'm just following this thanks to some comments in the community, and just passing by to linking this issue with https://github.com/IFCjs/web-ifc/issues/504.
I think this is now fixed at least the rendering elements - can you please re-open if not the case
Describe the bug 📝
I am testing the first non-alpha version of OBC (1.1.0) and I observe that some models IFC, are not displayed correctly, you can see an example in the image, also does not show the properties, in these cases that is not displayed well.
The code, is the one of the tutorial FragmentIfcLoader + ifcPropertiesProcessor but implemented in React.
left OBC, right web-ifc-viewer
And the console, show the attached error for the properties.
Testing IFC Model (Zipped for upload): XXXX_AARR.zip
Reproduction ▶️
No response
Steps to reproduce 🔢
No response
System Info 💻
Used Package Manager 📦
npm
Error Trace/Logs 📃
index.ts:146 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'value') at _IfcPropertiesUtils.getEntityName (index.ts:146:37) at _IfcPropertiesProcessor.newEntityTree (index.ts:462:41) at _IfcPropertiesProcessor.newEntityUI (index.ts:294:28) at _IfcPropertiesProcessor.renderProperties (index.ts:268:21)
Validations ✅