TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: V-Man on July 29, 2008, 07:53:59 AM

Title: Move selected @ distance
Post by: V-Man on July 29, 2008, 07:53:59 AM

Ok, this is a real easy one for you guys. I am trying to make a command to ask the user to select on an object (1 at a time) then it would then move that object a certain distance away from it's original posistion and loop through until cancelled. This is what I have. Please don't laugh, it's early Tuesday morning?

Code: [Select]
(command c:lwf ()
(setq ss1 (ssget))
(command "move" ss1 "" "0,0" "2000'<180")
)

This does not work.

Don
Title: Re: Move selected @ distance
Post by: Patrick_35 on July 29, 2008, 08:00:08 AM
Hi

Code: [Select]
(defun c:lwf(/ sel)
  (while (setq sel (entsel))
    (command "_.move" (car sel) "" "0,0" "2000<180")
  )
)

@+
Title: Re: Move selected @ distance
Post by: V-Man on July 29, 2008, 08:04:34 AM

Thanks Patrick_35  That's exactly it.

Quote
(defun c:lwf(/ sel)
  (while (setq sel (entsel))
    (command "_.move" (car sel) "" "0,0" "2000<180")
  )
)
Title: Re: Move selected @ distance
Post by: CAB on July 29, 2008, 12:04:14 PM
If you ever want to move all at once use this:
Code: [Select]
(defun c:lwf (/ ss)
  (prompt "\nSelect items to move:")
  (if (setq ss (ssget))
    (command "_.move" ss "" "0,0" "2000<180")
  )
  (princ)
)
Title: Re: Move selected @ distance
Post by: V-Man on July 30, 2008, 07:03:22 AM

Thanks for the tip CAB