Skip to main content
Question

I am trying to expose IFC attributes based on the ifc_property_set collection of names. The end result should be a feature with only the ifc_property_set attributes exposed on the feature.


As the IFC property sets are configured in other systems i do not have prior knowledge of the attributes to expose these for the writers. I need to be able to feature attribute cleanup so that i can expose these attribute collections without prior knowledge of the feature information.

I have successfully exposed the attributes from the collections as a feature attribute but these are still hidden from the writer. I am able to interrogate each feature and build a picture of those attributes in Python but cannot seem to expose these programmatically. 

 

def processFeature(feature):
    print("**Processing feature**")
    print(feature.getAttribute('ifc_property_set'))
    #ifcpropertieslist = feature.getAttribute('ifc_properties')
    print(feature.getAllAttributeNames())
    i=0
    attrNames=feature.getAllAttributeNames()
    elementCount = int(feature.getAttribute("_element_count"))
    print(elementCount)
    exposeAttrsNames={}
    for i in range(elementCount):
        attrname = "ifc_properties{"+str(i)+"}.name"
        #print(attrname)
        #print(feature.getAttribute(attrname))
        featAttrName = feature.getAttribute(attrname)
        
        exposeAttrsNames[featAttrName] = feature.getAttribute(featAttrName)
    print(exposeAttrsNames)
    pass

Excuse the disorganization its a work in progress

FMEIFCAttr 

 Any ideas would be apricated. 

0 replies

Be the first to reply!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings