Saturday, May 2, 2009

Xrecords - what are they

I have been surprised by the number of people who have no idea what I am talking about when I mention Xrecords. For that reason I am taking this opportunity to explain what Xrecords are.

The first thing we need to acknowledge is that an AutoCAD drawing is not only a drawing but it is also a database with graphical representation. For this blog topic we are going to talk about the database side of AutoCAD drawings.

Xrecords are a means to store data within the database of the drawing using group codes. In short, Xrecords are data containers that have no graphical representation. Xrecords can hold any data you desire and makes use of the same group code numbering system as the AutoCAD objects (lines, circles, etc...). This data can be as simple as a layer name to a class object that is serialized and streamed into an Xrecord. One common practice I like is to use Xrecords as a means to store variables such as width, height and length of an object and use it in equations within a program. The class object is quite powerful as it allows you to use the data within the Xrecord at anytime in your program such as for engineering calculations for a drawing that can be connected to a third party application.

Xrecords are created in two arrays, one being the group codes and the other the data itself. The size capacity for an Xrecord is huge. Xrecords are placed in dictionaries which, in turn, can be stored within the overall drawing file or attached to an entity. (Dictionaries and xdata are two items we will discuss in greater detail at another time.) It is important to note you cannot gain access to Xrecords from standard ‘out of the box’ commands in AutoCAD. Access to Xrecords requires programming ability.

When it comes to the use of Xrecords your imagination is your only constraint.

Please contact me or respond to this blog to share your comments and questions.

Patrick Johnson

Labels: ,

0 Comments:

Post a Comment