Parsing IFC data structures

Hi All,
I'm using IfcOpenShell to parse IFC files and extract meta data from them. All went right unill I've encountered the 'Roles' case.
So the general question is how to instantiate or parse a valid IFC structure without binding it to a file? Like I need to parse (#8792=IfcActorRole(.USERDEFINED.,'CONTRIBUTOR',$),)
If I will call
__roles = ifcopenshell.entity_instance(item.Roles) ,
I will get TypeError: new_IfcBaseClass() missing 1 required positional argument: 'name'

Comments

  • Looks like you're passing in a tuple of entities, not a single entity. Just do ifcopenshell.entity_instance(item.Roles[0])

  • ejsejs
    edited January 28

    Hi,
    It will not help, as in the very first lines of entity_instance.__init__() is isinstance(e, tuple), wich is calling new_IfcBaseClass(*e).
    And yes, I've tried. The error is exactly the same.
    I'm on the ifcopenshell is v0.8
    This is the minor issue right now, as I don't really need to track or comment on the Organisations in the IFC container. And the fun fact the issue appeared when ifcopenshell 0.8 was used on the IFC data, as 'CONTRIBUTOR' is breaking my code :)

  • ejsejs
    edited January 29

    Hi All,
    I think there is race condition in ifcopenshell.util.element.get_psets()
    If an element is defined by several P/Qset with identical name, only one ID of P/Qset is returned, but values are merged. Multiple P/Qsets can be defined either at the element, or at the type level.
    I was trying to reach "Dimension" Psets and copy some values to "Pset_ElementCommon".

Sign In or Register to comment.