Adapts old Lisp to move selected objects - if selection is nil

Adapts old Lisp to move selected objects - if selection is nil

mihai_bantas
Enthusiast Enthusiast
1,621 Views
2 Replies
Message 1 of 3

Adapts old Lisp to move selected objects - if selection is nil

mihai_bantas
Enthusiast
Enthusiast

Hello to all, I have an older lisp code that works very well ... but I want to make a small change and I admit that I'm a little stuck in the situation ...the code moves different objects to the specified points
What i want to add to this code is the following phrase ... suppose I have 5 objects to move and the code forces me to move 10 objects ... how do I just move 5 objects instead of 10 objects

If someone can help me with a hint of advice ...remain grateful

 

 

0 Likes
Accepted solutions (1)
1,622 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

... hit enter when you're done.

 

(defun c:MN ( / idx ss pnt)
  
  (setq idx 0)
  
  (while (and (princ (strcat "Select items " (itoa (setq idx (1+ idx))) "! <done>"))
              (setq ss (ssget "_:L"))
              (setq pnt (getpoint (strcat "\Selects the point of moving elements " (itoa idx) ": ")))
              )
    (command "_.move" ss ""
             "_none" pnt
             "_none" (list (+ 60.87 (* 420. (1- idx))) 93.91)))
  (princ)
  )
Message 3 of 3

mihai_bantas
Enthusiast
Enthusiast

Thanks for help BeekeeCZ  ... the code goes fine

0 Likes