Jump to content

User Defined / Embedded / Searchable Dimension Tokens


Recommended Posts

Posted

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.

Posted

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.

Posted
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

Posted

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?

Posted
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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...