Question

Expose unknown Civil Property Sets by prefix - dynamic writer

  • 14 January 2020
  • 6 replies
  • 5 views

Userlevel 3
Badge +12

Hi,

 

Goal of this workbench was to be able to expose the property sets attributes of a Civil dwg, without knowing the attribute names. I am only interested in the property sets starting with a fixed prefix. I have started from some python code I found here: python attribute names

Topic is related to:

https://knowledge.safe.com/idea/18842/bulkattributeexposer-expose-all-possible-attribute.html

https://knowledge.safe.com/questions/32777/how-to-expose-all-attributes-in-generic-way-any-ma.html

 

Since I don't know the attribute names beforehand, I have to use a dynamic writer.

First I was trying to avoid this, since I am not familiar with the dynamic workflow, so I was writing everything to a json string, so that I was able to write all desired output. But now I am trying to use the dynamic writing functionalities.

I have 2 questions:

1/ the attribute names in the shapefile output are too short (have a length of only 1-3 characters). How can I fix this?

2/ Is it possible to put all exposed attributes into the FME table? The complexity is that I don't know the amount of attributes and the attribute names beforehand, so I cannot use the AttributeCreator. Or is there a way to create attributes based on a list (not having to save the list and importing it back)?

 

Jasper

 


6 replies

Userlevel 1
Badge +21

Issue 1 is because you cannot create attributes with the names you are trying to create

e.g. it is not possible to create a shapefile attribute with the name LIB - set1.prop1 - the spaces, and characters (- and .) as well as the overall length are all problems here.

Userlevel 3
Badge +12

Thank you, wasn't aware of this. Field name length limited to 10 characters.

Any idea for issue 2?

Userlevel 1
Badge +21

Thank you, wasn't aware of this. Field name length limited to 10 characters.

Any idea for issue 2?

I'm not sure what you mean by FME table

Userlevel 3
Badge +12

I'm not sure what you mean by FME table

I mean over here:

or here:

So I can use these attributes in the next steps of the workbench.

If I would know the names and the amount of attributes beforehand, I could add a AttributeCreator before the PythonCaller. But I don't. So basically, I am looking for a way to add these attributes (found in the Python script) to the output port of the PythonCaller.

Userlevel 1
Badge +21

I mean over here:

or here:

So I can use these attributes in the next steps of the workbench.

If I would know the names and the amount of attributes beforehand, I could add a AttributeCreator before the PythonCaller. But I don't. So basically, I am looking for a way to add these attributes (found in the Python script) to the output port of the PythonCaller.

It's not possible to do what you are suggesting. If it is a dynamic workflow there is no need to expose the attributes in the workspace.

Userlevel 3
Badge +12

It's not possible to do what you are suggesting. If it is a dynamic workflow there is no need to expose the attributes in the workspace.

There is one need in my point of view: using those attributes further one in the workbench in the standard transformers. I catch those values in the pythoncaller, but they stay more or less unexposed.

Reply