Skip to main content
Solved

Problem IFC reading user attributes

  • March 29, 2018
  • 5 replies
  • 53 views

Forum|alt.badge.img

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.

Best answer by lars_de_vries

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.

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.

5 replies

lars_de_vries
Forum|alt.badge.img+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.


Forum|alt.badge.img
  • Author
  • March 29, 2018

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 !

 

 


jneujens
Forum|alt.badge.img
  • March 30, 2018
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.

Forum|alt.badge.img
  • Author
  • April 3, 2018

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 ?

 


jneujens
Forum|alt.badge.img
  • April 12, 2018
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)