Skip to main content
Question

Unable to add xdata to a .dwg

  • December 10, 2014
  • 4 replies
  • 140 views

Forum|alt.badge.img
Hi

 

 

I would like to read a layer from a .dwg (polygons) and add different types of xdata (code 1000/string, code 1002/control, code1005/handle, …) to each polygon in a predefined position (ex. autocad_extended_data_list{6} to {9}) and writing it back to the .dwg source. This is what I did:
  1. Read the .dwg using ACAD reader (DXF/DWG)
  2. Expose the autocad_extended_data_list{} and its items
  3. Using a PythonCaller or AttributeCreator set the values for each item of the list
  4. Using ACAD writer (DXF/DWG) write back the layer to .dwg (set attribute output: Extended Entity Data)
Here is the problem:

 

I couldn't get the FME to write back the xdata!

 

 

I can get my xdata only if I create some "User Attributes" in my outpt layer (feature type properties), however the final values are not what I expected: instead of « string:test1 » I will get « string:"Name of User Attribute"=test1 » !

 

 

Could you please help me with that

 

Many thanks

 

 

Hani 
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.

4 replies

takashi
Celebrity
  • December 10, 2014
Hi Hani,

 

 

If the source features have "autocad_extended_data_list{n}" (n = 6-9), I think you can overwrite them with the AttributeCreator.

 

 

Takashi

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • December 11, 2014
not entity_handle. Writer will (re)create it.

Forum|alt.badge.img
  • Author
  • December 11, 2014
@Takashi

 

 

Thanks Takashi, yes you are right. I can modify the values and keep the part which I need in second step, however I was looking for a method to add xdata in one shot. Is it impossible with FME?!

 

 

@Gio

 

 

You read my mind! here my questions reagrding polygon handles:

 

 

1- Is there any way to write xdata to a polygon without touching its handle? in simple words, Is it possible in FME to simply modify a .dwg and not rewrite it?

 

 

2- Using FME can I set the value for "autocad_entity_handle" using values from another field?

 

 

Many thanks in advance for your answer

 

 

Hani

Forum|alt.badge.img
  • Author
  • December 12, 2014
I kind of found a way out :)

 

 

I realized that ACAD writer in each run gives a same handle to polygon! so:

 

1- Run workspace with ACAD writer for first time

 

2- Saving "autocad_entity_handle" values in a table using second workspace

 

3- Run original workspace for sencond time and add entity_handles as xdata for each polygon

 

 

I hope that helps the others

 

 

Hani