Skip to main content
Solved

Problem IFC reading user attributes


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.

View original
Did this help you find an answer to your question?

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
lars_de_vries wrote:

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
louis_c3 wrote:
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
lars_de_vries wrote:

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
louis_c3 wrote:
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) 

 


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