Solved

Writing extended data to DWG

  • 28 November 2017
  • 4 replies
  • 18 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.

icon

Best answer by jyardley 29 November 2017, 10:26

View original

4 replies

Badge +2
@jyardley can you attach the source DWG file?

 

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.

Badge

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!

@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 

Reply