NewEraCustomDesign Posted February 21, 2012 Posted February 21, 2012 Is there a way to embed a user defined token in a dimension property that can be later searched for using LISP routine? The ultimate goal would be to have these tokens exported to excel whereby the token value would determine its association with other dimensions and be placed according to their relationships within the spreadsheet. Any help/validation on my thoughts would be greatly appreciated. Quote
Lee Mac Posted February 21, 2012 Posted February 21, 2012 Welcome to the forum I would recommend using xData for your task, a reference for which can be found here: http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-7943.htm xData can be attached to all graphical entities, and also non-graphical entities as well. Quote
NewEraCustomDesign Posted February 21, 2012 Author Posted February 21, 2012 Thnx For The Reference Material - I am only somewhat fluent in LISP & BASIC coding but if I understand the concept correctly...the extended data definitions will be where my token is hidden to establish the relationships. The subsequent LISP routine must therefore reference the data type. After which, the LISP routine can automatically export the prefiltered data to excel as deemed appropriate by the desired format. Quote
Lee Mac Posted February 21, 2012 Posted February 21, 2012 Thnx For The Reference Material - I am only somewhat fluent in LISP & BASIC coding but if I understand the concept correctly...the extended data definitions will be where my token is hidden to establish the relationships. The subsequent LISP routine must therefore reference the data type. After which, the LISP routine can automatically export the prefiltered data to excel as deemed appropriate by the desired format. Sounds like you have the basic idea - the advantage of using xData is that the xData AppID can be used in an ssget expression to collect only those objects to which you have assigned xData under that AppID, for example: (ssget "_X" '((-3 ("YourAppID")))) Would collect a SelectionSet of all objects with the xData AppID: "YourAppID". Here's another tutorial to help: http://www.afralisp.net/autolisp/tutorials/extended-entity-data-part-1.php Quote
NewEraCustomDesign Posted February 21, 2012 Author Posted February 21, 2012 When I follow the tutorial in your reference, for some reason I cannot "create the exdata that we want to add to the entity" without getting an open ended prompt that looks like (_> If I continue with the tutorial --- it appears all of the effort to append the XDATA to the object never gets attached. My line entity data slightly differs from that of the expected result. Could this be the problem or am I missing something else? Quote
Lee Mac Posted February 21, 2012 Posted February 21, 2012 When I follow the tutorial in your reference, for some reason I cannot "create the exdata that we want to add to the entity" without getting an open ended prompt that looks like (_> This just means you are missing a right parenthesis - ")", there could be a mistake in the tutorial perhaps. Here is an example demonstrating how to add xData (a simple string in this case) to a selected entity: (defun c:test ( / en ) (if (setq en (car (entsel))) (progn (if (null (tblsearch "APPID" "MyAppID")) (regapp "MyAppID") ) (entmod (list (cons -1 en) '(-3 ("MyAppID" (1000 . "This is a test"))))) ) ) (princ) ) Note that the example doesn't test whether the entity already contains the xData, this could require another simple conditional; though repeated application to the same entity would just overwrite the existing identical xData. You might find my EntityList developer utility program helpful in this task. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.