Could someone look at this and tell me what I am doing wrong. It's been a long time since I tried to do a lisp routine and I never really got the hang of it. So please don't laugh. ;-) Could you please tell me what I am doing wrong here? Thanks in advance. Rob (defun c:mr (/ OLD_OS NEW_OS RTU_BLK) (setq OLD_OS (getvar "osmode")) (setq NEW_OS (setvar "osmode" 675)) (defun from (/ PT-1 PT-2) (setq PT-1 (getpoint "\nSelect Column or Wall: ")) (setvar "LASTPOINT" PT-1) (setq PT-2 (getpoint "\n<Offset Distance>: ")) ) (setq RTU_BLK (nentsel "Select RTU") ) (command "move" RTU_BLK (from)) (setvar "osmode" OLD_OS) (princ) )
You're working too hard (i.e., unneeded code). Try this: (defun c:mr (/ OLD_OS RTU_BLK) (setq OLD_OS (getvar "osmode")) (setvar "osmode" 675) (setq PT-1 (getpoint "\nSelect Column or Wall: ")) (setq PT-2 (getpoint "\n<Offset Distance>: ")) (setq RTU_BLK (nentsel "Select RTU")) (command "move" RTU_BLK "" PT-1 PT-2) (setvar "osmode" OLD_OS) (princ) )
;; Very close, try this modified version. (defun c:mr (/ OLD_OS RTU_BLK PT-1 PT-2) (setq OLD_OS (getvar "osmode")) (setvar "osmode" 675) ; (setq PT-1 (getpoint "\nSelect Column or Wall: ")) (setvar "LASTPOINT" PT-1) (setq PT-2 (getpoint "\n<Offset Distance>: ")) (setq RTU_BLK (nentsel "\nSelect RTU")) (if RTU_BLK (command "move" RTU_BLK pt-1 pt-2) );if (setvar "osmode" OLD_OS) (princ) ) Bob
As far as I can see, setting LASTPOINT serves no purpose, and (command "move" RTU_BLK pt-1 pt-2) requires another "" to close out the selection set: (command "move" RTU_BLK "" pt-1 pt-2) ___
Ditto, but just a little tighter: (defun c:mr (/ OLD_OS) (setq OLD_OS (getvar "osmode")) (setvar "osmode" 675) (command "move" (nentsel "\nSelect RTU") "" (getpoint "\nSelect Column or Wall: ") (getpoint "\n<Offset Distance>: ")) (setvar "osmode" OLD_OS) (princ) )
I'm sorry guys, I tried all of them and it still just goes thru the routine without doing any move. What I am trying to do is select the block, pick it up by an endpoint and move it by however many feet or inches to either side/or up,down of the wall or column that was indicated by PT-1. The routine runs through and doesn't error out, yet it doesn't move the block either. Thanks in advance again, I guess I should've said what I was trying to do in the first place. I am kind of trying to emulate the move command using the "from" + "nea or per" osnap and moving the cursor to any side of the pick point that is indicated when I do this and giving direct input coordinates entry. Hopefully I have explained what I am trying to do, as you might notice, I also have a problem sometimes conveying what I am thinking. ;-) -Rob
; Modified, using (ssget) instead of (nentsel) ; (defun c:mr (/ OLD_OS RTU_BLK PT-1 PT-2) (setq OLD_OS (getvar "osmode")) (setvar "osmode" 675) (setq PT-1 (getpoint "\nSelect Column or Wall: ")) (setq PT-2 (getpoint "\n<Offset Distance>: ")) (setvar "osmode" 0) (prompt "\Select RTU") (setq RTU_BLK (ssget)) (if RTU_BLK (command "move" RTU_BLK "" pt-1 pt-2) );if (setvar "osmode" OLD_OS) (princ) ) Cheers Bob
Thanks Bob, it still doesn't work like I want it to. I was doing some more work on it yesterday and tried to figure out how to add to it so that I can tell it which side of the column or wall I want to move it to and I must say it is becoming more involved than I figured on. I don't think I could drink enough coffee to help me that much. ;-) Thanks again, I have a project I have to get out today so it may be next week before I can get back to it and post what I have done. -Rob