Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoLisp Question re: Leaders 2

Status
Not open for further replies.

chrisj5

Civil/Environmental
Jul 12, 2001
4
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
 
Replies continue below

Recommended for you

Hi Chris
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.
;
(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)
);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor