Closed WZFWork closed 9 months ago
My guess is that you're missing an inverse - likely the StyledByItem
inverse on the GeometryRepresentationItem.
The semantic filter delegate is filtering out all inverses except for IsTypedBy and IsDefinedBy. This would exclude the StyledByItem inverse relationship. You may also need to account for other representations (like MappedRepresentation)
I find Xbim Xplorer a handy tool to understand these relationships in your model - alongside the IFC documentation - Xplorer lets you follow the hyperlinks in the properties to see the Ifc structure:
e.g. see the diagram (Fig 366) at https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD1/HTML/link/ifcstyleditem.htm
You'll see the properties window shows the IfcFacetetBrep for a Wall which I navigated to via:
IfcWall.Representation-> IfcProductDefinitionShape -> IfcShapeRepresentation -> IfcFacetedBrep (subclass of IfcGeometricRepresentationItem) ====> StyledByItem
This last step is an 'Inverse' relationship. ie. like a many-many table in a database. So the predicate needs to be extended to allow this part of the IFC graph to be copied.
Try changing the delegate to something like this:
If _property.EntityAttribute.Order < 0 AndAlso
Not (_property.PropertyInfo.Name = NameOf(IIfcProduct.IsDefinedBy) OrElse
_property.PropertyInfo.Name = NameOf(IIfcProduct.IsTypedBy) OrElse
_property.PropertyInfo.Name = NameOf(IIfcRepresentationItem.StyledByItem) ) Then
Return Nothing
End If
Return _property.PropertyInfo.GetValue(parentObject, Nothing)
Thank you very much for the detailed answer from Andy. The Xbim Xplorer tool is very easy to use,I am using this tool to improve my understanding of the structure of IFC. Thank you again for taking time out of your busy schedule to answer my questions, Master.
Hi, Master
I have just been exposed to XBIM for a short time, and I am not familiar with some objects and methods. Please teach me. I am copying an IfcStore entity to another IfcStore, and all the entity's Ifc styledItem properties are missing.
I know the problem lies in the semanticFilter delegate function, but I don't know how to reflect IfcstyledItem.
I hope someone can answer, thank you in advance.