web-ifc-viewer
web-ifc-viewer copied to clipboard
Prevent picking an ifcSpace or IfcAnnotation if it wasn't generated
Items that are not generated (ifcspaces sometimes, ifcannotation always) show up in the spatial tree and can be selected. Because if the camera is animated to go to the selection, and the ifcspace doesn't exist, the camera goes to infinity and breaks.
https://github.com/IFCjs/ifcjs-crash-course/tree/main/exercises/CSS/Flexbox
Hi, Same problem happens if selecting from Structure tree the IfcProject, IfcSite, IfcSpace, IfcBuildingStorey, and I assume some others elements... Here you can have an example : https://discord.com/channels/799990228336115742/800000126998675457/1023227872309162064
I found a way to prevent this behavior :
const props = await this.IFC.getProperties(modelID,expressID, false, true);
if ( props.Representation ) {
this.IFC.selector.pickIfcItemsByID(modelID, [expressID], true);
}