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.

  • November 13, 2020
  • 0 replies
  • 19 views

stuartpaice
Participant
Forum|alt.badge.img

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. 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.