AutoCAD 2013/2014/2015

AutoCAD 2013/2014/2015

Reply
Member
dagur_
Posts: 3
Registered: ‎02-14-2013
Message 1 of 5 (206 Views)

[DXF] Application defined codes in entities

206 Views, 4 Replies
02-14-2013 12:27 AM

I'm looking for a way to tag entities (for example arc) in a DXF with an numeric ID of my choosing. I've been trying to understand the DXF reference and find examples of how to do it, but there is not much information available. My interpretation of the standard is that I'm allowed to do this:

 

0
ARC
8
Layer1
10
-1.734315
20
-1.975000
40
0.300000
50
225.000027
51
270.000065
102
{MYAPPLICATION
2000
13
102
}

 

Where 2000 is my application defined code and 13 is my numeric ID value.

 

Is this correct use of application defined codes?

 

EDIT: I also asked a similar question at stackoverflow, without anyone being able to answer it.

*Expert Elite*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 2 of 5 (199 Views)

Re: [DXF] Application defined codes in entities

02-14-2013 12:38 AM in reply to: dagur_

Hi,

 

look to Extended-Entity-Data (EED) in the DXF-documentation (>>>details<<<), there you can assign some additional values to each element.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Member
dagur_
Posts: 3
Registered: ‎02-14-2013
Message 3 of 5 (186 Views)

Re: [DXF] Application defined codes in entities

02-14-2013 12:54 AM in reply to: Alfred.NESWADBA

Like this?

 

0
ARC
8
Layer1
10
-1.734315
20
-1.975000
40
0.300000
50
225.000027
51
270.000065
1001
MYAPPLICATION
1070
13

Am I using xdata correctly? Also, is this correct/better way to define my numeric ID?

*Expert Elite*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 4 of 5 (168 Views)

Re: [DXF] Application defined codes in entities

02-14-2013 01:21 AM in reply to: dagur_

Hi,

 

the easiest way to verify how EED's should be stored is to create a new drawing, then draw a new line, start command _XDATA (from the express tools) and add test data to this line.

Afterwards save the file as DXF and look to the EED how it's stored.

 

Good luck, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Member
dagur_
Posts: 3
Registered: ‎02-14-2013
Message 5 of 5 (148 Views)

Re: [DXF] Application defined codes in entities

02-14-2013 06:51 AM in reply to: Alfred.NESWADBA

Thank you, this solves my problem. Using _XDATA as suggested, Autocad added the following to my arc description:

 

1001
MYAPPLICATION
1002
{
1070
    12
1002
}

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.