Index Cover
Extended Entity Data

Using Extended Entity Data (EEDs or Xdata)

Extended Entity Data (EEDs or Xdata) is a way to link external data to an AutoCAD object. Many of the Autodesk Vertical products (ADE, Map, etc.) use this technique as well as 3rd party products such as CART and some surveying packages.

The usefulness of this linked data for ASRix users lies in the possibilities for automation if you tailor your drawing standards take advantage of the EEDs attached to the CAD objects. Essentially all you should have to do is click on an object and have the correct image open in ASRix. You can get the same effect by putting your objects on appropriately named layers but this usually becomes a manual process, more time consuming and prone to errors.

If the EEDs in your drawings come from an Autodesk product the extraction routine distributed with ASRix will probably work with no modification, if not you may have to create and edit the Xdata routine

There are three commands that you will need, which are available from the ASRix menu (section 5). They are:

  1. GXL Get Xdata list
  2. Which returns the Xdata list of an object (if it exists) to show you what the data attached to your entities looks like. You will get an Alert showing either an alert with the xdata list or notifying you that no xdata was attached to the entity. In either case the AutoCAD Text Window will display the full entity list for that object (so you can see for yourself).

  3. Edit Xdata routine
  4. This command will let you customize the way in which ASRix will interpret the Xdata in your drawings by creating a file ASRxdata.lsp that you can customize to suit the EEDs in your drawings.

    The first time you use this command you will be asked to select a directory in which to create this file. It will have to be somewhere that AutoCAD can find it so you will be shown a list of directories on the AutoCAD search path and you must select one of them.

    In most situations you should put it in the same directory you selected for ASRix.lsp during the install process. This will make it accessible regardless of the directory in which you are working. However, if the Xdata format you want to capture is unique to one group of files you should put the file in the same directory as the drawings (typically the first one on the list). This will mean that it will be found only if you are working on files in that directory.

    Note: In Release 14 you have to start AutoCAD by double clicking a file in that directory for the local path to show up on the list and you will have to open your AutoCAD session this way for the locally installed functions to work. Later versions of AutoCAD handle this better.

    If ASRxdata,lsp was successfully created It will be opened using Notepad.exe ready for your modifications. The explanation and instructions for modification are included in the file. (It is a good idea to sign and date your modifications for future troubleshooting)

    If there was already an ASRxdata.lsp on the AutoCAD search path you will bypass the creation step and go straight to the editor.

  5. Delete Xdata routine
  6. This will delete the Xdata routines created using the previous command. This command searches for an instance of ASRxdata.lsp and gives you the opportunity to delete it.

    Note: It is possible that you can have more than one instance of ASRxdata.lsp so, to get rid of them all you may have to run this command more than once. To find out if you are using the default one or a customized version (and which customized version) you can use the Which ASRix? command from the Utilities section of the ASRix menu.

The default ASRxdata.lsp is reproduced below.

Next The DWF Format

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; August 23, 2007
;;;; ASRxdata.lsp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Edited by: _______________
;;;; To be edited by an AutoLISP knowedgeable user to trap
;;;; the specific XDATA format used by their application
;@;; Search for "@" to locate Editable sections
(defun ASRx( ent /                                   ;
;  el      ; entity list                             ;
;  xl      ; eXtended entity list                    ; Variables unprotected
;  tbl     ; Table name                              ; for trouble shooting
;  xtb     ; an Xdata table                          ;
;  xdv     ; an Xdata value                          ;
;  xona    ; value of primary table                  ;
  )                                                  ;
 (setq el() xl() tbl() xtb() xdv() xona() )          ; clear globals
 (if (null (setq ASRcur (findfile "ASRxdata.lsp")))  ;
           (setq ASRcur "Default ASRx"))             ;
 (setq el (entget ent '("*")))                       ; get complete entity list
 (if (setq xl (cdr (assoc -3 el)))                   ; seperate Xdata list
  (cond                                              ;
   ((= "PE_URL" (setq xdv (caar xl)))                ;
    (setq xona (cdr (cadar xl)))                     ;
   )                                                 ;
   ((not ( = "ACAD" (caar xl)))                      ; strip out MTEXT
    (foreach l (cdr (reverse (cddar xl)))            ; loop through xdata pairs
     (setq xdv (substr3 (cdr l) "=" 1))              ; data value
     (setq tbl (substr3 (cdr l) "=" 0))              ; database table
     (if (and (null xona)(= "&" (substr tbl 1 1)))   ; looks for primary table
      (setq xona (substr xdv 2 (- (strlen xdv) 2)))) ; removes quotes
;@;; To customize your Xdata query
;;;; Uncomment and edit the line following these instructions.
;;;; Xdata typically looks xomething like the following:
;;;; ((1000 . &LBF_06='2AWWE01')(1000 . PHOTO=R3F21)(1000 . PROJ=LBF_06))
;;;; You want to capture the value after the "="
;;;; by stating the string before it as in the example below which
;;;; would pass the value "R3F21" to ASRix from the Xdata above.
;;;;   (if (= "PHOTO" tbl)(setq xona xdv ))      ; xdata PHOTO=xdv
;;;; You should only have to change the "PHOTO" in the example
;;;; to whatever string your application uses and possibly
;;;; strip off some extra characters as in this example which
;;;; would pass the value "2AWWE01" to ASRix from the Xdata above.
;;;; (if (= "&_LBF_06" tbl)(setq xona (substr xdv 2 (- (strlen xdv) 2))))
;;;; By default the value from the primary "&" table will be used
;;;; and if this is absent the value from the first Xdata value
;;;; will be used so there is a pretty good chance you won't have
;;;; to do anything here so test it first.
;;;; To find out what your xdata looks like use the "ASRx" command
;;;; and select an object, cancel, then type "!XL" at the command line
;;;; !EL will give you the complete entity list
;;;; !XDV will show the first Xdata value
;;;; !XONA will show the value, if any, trapped by your statment
;@;; Uncomment and Edit the following line to trap your Xdata format

;    (if (= "PHOTO" tbl)(setq xona xdv ))

    ); end of loop ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   (prompt (strcat "\n"ASRcur" : No Xdata on this object\t"))
(if xona xona xdv)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Up Index Cover

Inquiries to:

Generated by: CART
(Thu Sep 13 07:01:56 2007 )