Skip to main content
Solved

Writing extended data to DWG

  • November 28, 2017
  • 4 replies
  • 125 views

I am having some problems writing extended attributes to a dwg, I have attached the source dwg and my workflow.

The source dwg contains a polyline that has several fields of extended data, my aim is to be able to change a few of the fields with a string replacer, for example in this case change “JSY” to “CWG”.

I am able to inspect the extended data list in the reader and change the values, however when it comes to writing to dwg the attributes don’t come through. Running the command XDLIST, shows no extended entity data on the entity.

Any help would be appreciated.

Best answer by jyardley

Hi Mark,

I am unable to upload the dwg for some reason. However after a lot of searching last night I have found the solution, it appears that the extended data field "application_name:" must be contained in a template when writing out to DWG or none of the extended data will be written.

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

Forum|alt.badge.img+2
  • November 28, 2017
@jyardley can you attach the source DWG file?

 


  • Author
  • Best Answer
  • November 29, 2017

Hi Mark,

I am unable to upload the dwg for some reason. However after a lot of searching last night I have found the solution, it appears that the extended data field "application_name:" must be contained in a template when writing out to DWG or none of the extended data will be written.


sprongandre
Forum|alt.badge.img

Hi Mark,

I am unable to upload the dwg for some reason. However after a lot of searching last night I have found the solution, it appears that the extended data field "application_name:" must be contained in a template when writing out to DWG or none of the extended data will be written.

Hi @jyardley, I'm also struggeling with writing extended data. What do you mean by adding "application_name:" to a template? Could you post an example file(set, dwg and workbench)?

That would be great!

Thanks!


  • Author
  • August 21, 2019

@sprongandre "application_name" in autocad is the name of a set of xdata, which groups the xdata together. In order to create and manage xdata, you must register a unique application name.

 

For example the xdata I use on a polyline can be viewed using the command XDLIST, this also gives an option to view the xdata by application name (In this case it is showing all xdata for all application names *):

 

Command: XDLIST
Select object:
Enter application name <*>:
* Registered Application Name: MYAPP
* Code 1000, ASCII string: xdata1
* Code 1000, ASCII string: Drawing
* Code 1000, ASCII string: xdata3
* Code 1000, ASCII string: xdata2
* Code 1040, Real number: 0
* Code 1000, ASCII string: 20190821.11120301
Object has 16272 bytes of Xdata space available.

 

When using FME, this application name must be present in the template, so in my case I have to create an application name called "MYAPP" within the template.

 

See additional info here:

 

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-AutoLISP/files/GUID-8F373105-67D5-4CBD-931D-D0869F2A7EB5-htm.html