AutoLisp Question re: Leaders
AutoLisp Question re: Leaders
(OP)
Hi all,
I've been trying to access the vertex coordinates of a leader in Autolisp. It is easy to 'pull' the list value via its 'assoc' code but since there are multiple assoc 10 list values, I'm running into a wall. Anybody have some insight to access multiple 'assoc' values?
Thanks in advance.
Chris
I've been trying to access the vertex coordinates of a leader in Autolisp. It is easy to 'pull' the list value via its 'assoc' code but since there are multiple assoc 10 list values, I'm running into a wall. Anybody have some insight to access multiple 'assoc' values?
Thanks in advance.
Chris





RE: AutoLisp Question re: Leaders
I posted a sample lisp as FAQ right now, inspired by your question.
The trick is after each application of
(member (assoc 10 ....)
to truncate the entity list with
(cdr ....)
See the full function with tutorial comments in the FAQ area above.
Hope this helps.
www.homescript.com
;
(defun NextVertex1(ShortEDDY)
(princ "\nSuccessive access to (Assoc 10 EDDY) ... ")
(while (setq ShortEDDY (member (assoc 10 ShortEDDY) ShortEDDY))
;for debugging
(princ "\n(assoc 10 ShortEddy)..")
(princ (assoc 10 ShortEDDY))
;after debugging, put other function calls here
;to do things with vertex coordinates
;or assign the coordinates to a parameter, to use elsewhere
(setq nextVertexCoords (cdr (assoc 10 ShortEDDY)))
(setq ShortEddy (cdr ShortEddy))
)
(princ)
);