TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: snownut2 on March 03, 2012, 11:52:50 AM

Title: APPID Tables
Post by: snownut2 on March 03, 2012, 11:52:50 AM
I had the thought (I am sure not the first) that I could store variable data in an APPID Table.  There is no issue creating the table, however I am having issues adding variable values to it.

I need to store Text Variables, Integer Variables and Real Variables, up to 20 assorted types per APPID Table.

Any assistance would be great.

Thanks,

Bruce
Title: Re: APPID Tables
Post by: Lee Mac on March 03, 2012, 12:33:18 PM
The AppID Table (http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-7a57.htm) merely stores registered Application IDs and information about each AppID, just as the Layer Table stores Layer Names and information about each Layer.

You will need to study xData, which can be used to attach information (such as Integers, Reals, Points, Handles, Strings etc.) under a specific AppID to graphical and non-graphical objects.

Here are some tutorials:

http://www.afralisp.net/autolisp/tutorials/extended-entity-data-part-1.php (http://www.afralisp.net/autolisp/tutorials/extended-entity-data-part-1.php)

Reference:

http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-7943.htm (http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-7943.htm)
Title: Re: APPID Tables
Post by: irneb on March 04, 2012, 03:23:47 AM
There's another option as well: Dictionaries (not the spelling kind, but rather like a lookup table in excel). A pro over XData is there's no limit in size per entity (i.e. you can store 2GB of data onto one single APPID - not just 16kb). A pro and con is that it does not have structured ways of defining data types - each XRecord of a dictionary can hold any type of data and you need not place it in specific DXF codes like in xdata, in this way it's more like a lisp-association-list than a database. A definite con is that it's extremely difficult to selection set filter such data - xdata is relatively "simple" to filter for entities having only certain xdata values. Another con is it does not have "smart" data items, like handles linked to entities which could automatically change if copied / deleted / scaled / moved.

Here's a tut on dictionaries and xrecords: http://www.afralisp.net/autolisp/tutorials/dictionaries-and-xrecords.php

Also, making use of an APPID to store lisp data is extrelemy simple in VLisp. Just use the built-in ldata functions with your choice of APPID as dictionary name: