duke Posted May 4 Share Posted May 4 Hello friends !! I was wondering about XDATA, What is it for and how does it work within AUTO-LISP Because I don't know exactly if it works for what I'm thinking. Maybe you can create objects, for example: CIRCLES and internally assign each circle an internal data to each one, so that each and every one of the circles has a unique and unrepeatable and totally identifiable "NAME" Example: To join all the circles with a polyline, in a specific order, say from the circle called internally with a number 1 (ONE), to the circle number 5 (FIVE). Or XDATA is not used like that I put that as an example, but if it is used for other things, could you write me a small example code to understand how XDATA works, please Something very simple and small, you can And in advance, thank you very much ‼‼ Quote Link to comment Share on other sites More sharing options...
Steven P Posted May 4 Share Posted May 4 XData is essentially an additional bit of information added to the entity definition, it doesn't change how the entity is shown on the screen. What you want to do can be done, and this link is a good description https://www.afralisp.net/autolisp/tutorials/extended-entity-data-part-1.php 1 Quote Link to comment Share on other sites More sharing options...
duke Posted May 4 Author Share Posted May 4 8 hours ago, Steven P said: XData is essentially an additional bit of information added to the entity definition, it doesn't change how the entity is shown on the screen. What you want to do can be done, and this link is a good description https://www.afralisp.net/autolisp/tutorials/extended-entity-data-part-1.php Great !!! i am going to read Thanks bro ‼‼‼ Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 5 Share Posted May 5 (edited) "Joining circles via creation order", using ssget can most times do this, try it, but as was posted somewhere else doing a sort on the "Handle ID" of the objects is creation order. I seem to remember must change to a number not hex. Quick and dirty (defun wow ( / ss x) (setq ss (ssget '((0 . "CIRCLE")))) (command "pline") (repeat (setq x (sslength ss)) (command (cdr (assoc 10 (entget (ssname ss (setq x (1- x))))))) ) (command "") ) (wow) Edited May 5 by BIGAL 1 Quote Link to comment Share on other sites More sharing options...
duke Posted May 5 Author Share Posted May 5 (edited) 1 hour ago, BIGAL said: "Joining circles via creation order", using ssget can most times do this, try it, but as was posted somewhere else doing a sort on the "Handle ID" of the objects is creation order. I seem to remember must change to a number not hex. Quick and dirty (defun wow ( / ss x) (setq ss (ssget '((0 . "CIRCLE")))) (command "pline") (repeat (setq x (sslength ss)) (command (cdr (assoc 10 (entget (ssname ss (setq x (1- x))))))) ) (command "") ) (wow) ty BIGAL beauty example for creating a pline ‼‼‼‼‼ Edited May 5 by duke Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted May 5 Share Posted May 5 (edited) There aren't really many applications in which you would use xdata. I can only imagine needing one when you create your own applications like you would with a dictionary, in which you would like the objects to behave and "react" differently in respond to several commands. Again, what do I know... Here is one example of one of my programs in which xdata is used. (I hardly ever use this because I hardly see its use, but I just created it as practice for myself. Hence, I stopped enhancing it.) Edit: Apologies for the complex example, I didn't read the OP that it was intended to be simple... ObjectPropertySync.lsp Edited May 6 by Jonathan Handojo 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 6 Share Posted May 6 A good tutorial and description about using XDATA. https://www.afralisp.net/autolisp/tutorials/extended-entity-data-part-1.php 1 Quote Link to comment Share on other sites More sharing options...
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.