×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

AutoLisp Question re: Leaders
2

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

RE: AutoLisp Question re: Leaders

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.
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)
);

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources