Message 1 of 6

Not applicable
07-10-2018
05:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm currently working on a lisp routine (see below) that selects objects in order and saves the coordinates and rotation to the blackboard. So for object # you get xx#, yy# and r#. What happens at the moment is it goes through the loop fine (as far as I can tell), but then loops back to an entsel function, so if enter is pressed it crashes the routine. How do I format this code so I can select objects in order and press enter to end the while loop? Even better would be to avoid having to seperately select and hit enter for each object but I'm not sure how I'd structure that. Apologies in advance I'm really new to lisp.
Thanks
(vl-load-com) (defun C:VPP (/ sx xv yv vv vvl) (setq sx 0) (while (setq sx (1+ sx)) (setq vv (car (entsel))) (setq vvl (entget vv)) (setq xv (rtos (car (cdr (assoc 10 vvl))))) (setq yv (rtos (car (cdr (cdr (assoc 10 vvl)))))) (set (read (strcat "r" " (rtos sx)")) (rtos (cdr (assoc 50 vvl)))) (set (read (strcat "xx" " (rtos sx)")) xv) (set (read (strcat "yy" " (rtos sx)")) yv) ) (princ) )
Solved! Go to Solution.