Solved

Problem IFC reading user attributes

  • 29 March 2018
  • 5 replies
  • 4 views

Badge

Hi,

I'm reading an IFC file with an user-defined property set (PSET - Atrributs Mensura). I would like to check the values of those attributes. I don't understand why the DataInspector is able to read them (A_THEMATIQUE, B_TYPE, ...) but I can't reach them in the Workbench...

any idea ?

I'm using the "Industry Foundation Class STEP Files (IFC)" format with hierarchical data model and read property sets as Features.

icon

Best answer by lars_de_vries 29 March 2018, 13:37

View original

5 replies

Badge +10

If you see the attributes in de Data Inspector, you can expose them in the workbench by using a AttributeExposer transformer. You'll have to input the attribute names manually, but after that they will be available to you.

Badge

If you see the attributes in de Data Inspector, you can expose them in the workbench by using a AttributeExposer transformer. You'll have to input the attribute names manually, but after that they will be available to you.

Thanks ! Too bad it's a manual input but it works !

 

 

Badge
Thanks ! Too bad it's a manual input but it works !

 

 

That is simply how FME works. :)

 

If you are interested, we have worked out a way to automatically expose all attributes linked to a feature in python. I could always send you this custom transformer.
Badge

If you see the attributes in de Data Inspector, you can expose them in the workbench by using a AttributeExposer transformer. You'll have to input the attribute names manually, but after that they will be available to you.

Oh yes I'm interested. Even if it's just to look at the script, that would be useful !

 

Can you post it here, or do you need my email adress ?

 

Badge
Oh yes I'm interested. Even if it's just to look at the script, that would be useful !

 

Can you post it here, or do you need my email adress ? 

 

I know remember that it is only possible to get all attributes and values as a list of pairs of attributes and attribute values. Since you do not know the names of all the attributes, you cannot add them dynamically in you PythonCaller transformer. 

 

 

The code for that would be something like:

 

 def getAllAttributes(feature):
attrList = []
attrNames = sorted(feature.getAllAttributeNames())  index = 0  for attr in attrNames:  index += 1  value = feature.getAttribute(attr)  feature.setAttribute('attrList{index}.name', attr)  feature.setAttribute('attrList{index}.value', value) 

 

Reply