web-ifc-viewer icon indicating copy to clipboard operation
web-ifc-viewer copied to clipboard

Prevent picking an ifcSpace or IfcAnnotation if it wasn't generated

Open agviegas opened this issue 2 years ago • 4 comments

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

agviegas avatar May 31 '22 21:05 agviegas

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

horfee avatar Sep 26 '22 18:09 horfee

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);
}

horfee avatar Sep 27 '22 08:09 horfee