Author Topic: Move selected @ distance  (Read 1461 times)

0 Members and 1 Guest are viewing this topic.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Move selected @ distance
« 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
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

Patrick_35

  • Guest
Re: Move selected @ distance
« Reply #1 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")
  )
)

@+

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Re: Move selected @ distance
« Reply #2 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")
  )
)
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Move selected @ distance
« Reply #3 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)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Re: Move selected @ distance
« Reply #4 on: July 30, 2008, 07:03:22 AM »

Thanks for the tip CAB
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023