AutoLISP to Manipulate AutoCAD Objects' in the AutoLISP Developer's Guide. Revisions to the DXF Reference This topic lists revisions since the last update of the DXF Reference. The version number of this DXF Reference is u19.1.01. “ENTITIES Section” 1 1. Note: Panel symbols do not require any attributes but uses xdata for any missing attributes. This xdata is added when the symbol is inserted using the appropriate AutoCAD Electrical panel insertion command. For years AutoCAD has had the ability to store user information within a drawing by utilising attributes. But, attributes have got their limitations. They've got to be a block, or part of a block.
Active1 year, 7 months ago
I know there must be a way to extract custom Xdata from an Autocad drawing.
Could somebody please point me in the right direction of where to search?
I'm looking for a method or AutoLISP that will collect/extract the custom added, Xdatafrom a bunch of polylines. These polylines will have the following custom Xdata;
The standard 'Extract Data' method in Autocad does not extract any name or another reference to the extracted data. So there is no way telling which data is from which polyline.
Any help would be greatly appreciated.
stefanobaghino
6,00022 gold badges2020 silver badges4242 bronze badges
Michel85Michel85
2 Answers
To obtain xdata associated with a particular Application ID or multiple Application IDs, simply supply the entget function with the optional
applist argument following the entity name argument.
This argument is a list of Application IDs for which to return xdata (if present in the DXF data associated with the supplied entity).
Xdata Tag 100 Is Missing Autocad Free
For example, if your Application ID is
'MyAppID' , you would evaluate the entget function in the following manner:
(Note that I have supplied a quoted literal list in this example - for more information on this convention, refer to my tutorial on the subject).
To help you to inspect all DXF data (including xdata) associated with a particular entity, I have developed an Entity List program.
On selecting a polyline from your drawing using this program or by evaluating
entget with an application list argument of ('MYAPPID') , you may obtain a DXF data such as:
Therefore, the list of xdata may be accessed by acquiring DXF group -3 from this list:
Which will return:
If you are querying more than one Application ID, you may then acquire the data associated with your target Application ID using:
Or, if you are only returning the xdata associated with one Application ID, you could simply use:
Here,
cdadr is a contraction of (cdr (car (cdr))) .
This will then return:
From which you may retrieve the relevant values either using
assoc if the group codes are unique, or iterate over the list and rely on the association pair positioning.
Here is a test program for you to try:
Lee MacLee Mac
9,23366 gold badges1717 silver badges5555 bronze badges
The easiest way to get XData from the entity by LISP is:
Example code will ask You to select the entity and will display its XData.
Now You need to decide what to do with this informations. For example, You can save it to CSV file where each row will be one entity, and in the first column write object Handle (to get the connection between entity and data) then extracted data.
CAD DeveloperCAD Developer
69611 gold badge1111 silver badges1818 bronze badges
Not the answer you're looking for? Browse other questions tagged excelmetadataautocadextractionautolisp or ask your own question.Database Objects
(from the DXF Reference)
AutoCAD drawings consist largely of structured containers for database objects. Database objects each have the followingfeatures:
![]()
Symbol tables and symbol table records are database objects and, thus, have a handle. They can also have xdata andpersistent reactors in their DXF records.
DXF R12 Data Model
The DXF R12 data model is identical to the file structure:
References are realized by simple names. The INSERT entity references the BLOCK definition by the BLOCK name, a TEXTentity defines the associated STYLE and LAYER by its name and so on, handles are not needed. Layout association ofgraphical entities in the ENTITIES section by the paper_space tag
(67, 0 or 1) , 0 or missing tag means modelspace, 1 means paper space. The content of BLOCK definitions is enclosed by the BLOCK and the ENDBLK entity, noadditional references are needed.
A clean and simple file structure and data model, which seems to be the reason why the DXF R12 Reference (released 1992)is still a widely used file format and Autodesk/AutoCAD supports the format by reading and writing DXF R12 files untiltoday (DXF R13/R14 has no writing support by AutoCAD!).
TODO: list of available entities
DXF R13+ Data Model
With the DXF R13 file format, handles are mandatory and they are really used for organizing the new data structuresintroduced with DXF R13.
The HEADER section is still the same with just more available settings.
The new CLASSES section contains AutoCAD specific data, has to be written like AutoCAD it does, but must not beunderstood.
The TABLES section got a new BLOCK_RECORD table - see :ref:`Block Management Structures` for more information.
The BLOCKS sections is mostly the same, but with handles, owner tags and new ENTITY types. Not active paper spacelayouts store their content also in the BLOCKS section - see :ref:`Layout Management Structures` for more information.
The ENTITIES section is also mostly same, but with handles, owner tags and new ENTITY types.
TODO: list of new available entities
And the new OBJECTS section - now its getting complicated!
Most information about the OBJECTS section is just guessed or gathered by trail and error (reverse engineering), becausethe documentation of the OBJECTS section and its objects in the DXF reference provided by Autodesk is very shallow.This is also the reason why I started the DXF Internals section, may be it helps other developers to start one or twosteps above level zero.
The OBJECTS sections stores all the non-graphical entities of the DXF drawing.Non-graphical entities from now on just called 'objects' to differentiate them from graphical entities, just called'entities'. The OBJECTS section follows commonly the ENTITIES section, but this is not mandatory. DXF R13introduces also several new DXF objects, which resides exclusive in the OBJECTS section, taken from the DXF R14 reference,because I have no access to the DXF R13 reference, the DXF R13 reference is a compiled .hlp file which can't be read onWindows 10, a drastic real world example why it is better to avoid closed (proprietary) data formats ;):
Still missing the LAYOUT object, which is mandatory in DXF R2000 to manage multiple paper space layouts. I don't knowhow DXF R13/R14 manages multiple layouts or if they even support this feature, but I don't care much about DXF R13/R14,because AutoCAD has no write support for this two formats anymore. ezdxf tries to upgrade this two DXF versions to DXFR2000 with the advantage of only two different data models to support: DXF R12 and DXF R2000+
New objects introduced by DXF R2000:
New objects in DXF R2004:
Autocad Warning Xdata Tag 100 Is Missing
New objects in DXF R2007:
New objects in DXF R2013:
Xdata Tag 100 Is Missing Autocad 2016
New objects in DXF R2018:
Warning Xdata Tag 100 Is Missing In Autocad
Undocumented objects:
Objects OrganisationXdata Tag 100 Is Missing Autocad 2017
Many objects in the OBJECTS section are organized in a tree-like structure of DICTIONARY objects.Starting point for this data structure is the 'root' DICTIONARY with several entries to other DICTIONARY objects.The root DICTIONARY has to be the first object in the OBJECTS section. The management dicts for GROUP and LAYOUT objectsare really important, but IMHO most of the other management tables are optional and for the most use cases notnecessary. The ezdxf template for DXF R2018 contains only these entries in the root dict and most of them pointing toan empty DICTIONARY:
Root DICTIONARY content for DXF R2018Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |