MikeP Posted May 16, 2011 Share Posted May 16, 2011 Im being totally lazy on this one. but what would a lisp look like to simply select an object enter the command and all it does it move the object over 20" to left? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 16, 2011 Share Posted May 16, 2011 Simplest way: (defun c:test ( / ss ) (if (setq ss (ssget "_:L")) (command "_.move" ss "" "_non" '(0. 0. 0.) "_non" '(-20 0. 0.)) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
MikeP Posted May 16, 2011 Author Share Posted May 16, 2011 you are the man. Quote Link to comment Share on other sites More sharing options...
MikeP Posted May 16, 2011 Author Share Posted May 16, 2011 to help me out. I dont understand the "_:L" or the "_non" parts of the lisp. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 16, 2011 Share Posted May 16, 2011 (defun c:LazyMove ( / ss pt) (princ "\rI'M TOALLY LAZY ") (if (and (setq ss (ssget)) (setq pt (getpoint "\nSelect base point: "))) (command "._move" ss "" pt (cons (- (car pt) 20.) (cdr pt))) (cond (ss (prompt "\n** Invalid point ** ")) ((prompt "** Nothing selected ** ")))) (princ)) Quote Link to comment Share on other sites More sharing options...
MikeP Posted May 16, 2011 Author Share Posted May 16, 2011 sorry dude, I like lees way... I dont wanna have to pick a base point. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 16, 2011 Share Posted May 16, 2011 Simplest way: Nice one. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 16, 2011 Share Posted May 16, 2011 sorry dude, I like lees way... I dont wanna have to pick a base point. No worries; I like his better too. LoL Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 16, 2011 Share Posted May 16, 2011 to help me out. I dont understand the "_:L" or the "_non" parts of the lisp. The "_:L" simply ignores locked layers during the selection. The "_non" simply removes any accidental OSNAP interference. Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 16, 2011 Share Posted May 16, 2011 ***Really?*** Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 16, 2011 Share Posted May 16, 2011 to help me out. I dont understand the "_:L" or the "_non" parts of the lisp. Sure "_:L" - excludes objects on Locked Layers from the SelectionSet "_non" - 'None' OSnap, i.e. ignore ObjectSnap for the next supplied point. Quote Link to comment Share on other sites More sharing options...
MikeP Posted May 16, 2011 Author Share Posted May 16, 2011 ***Really?*** i have a number of objects that I have to keep moving over 20". In my head I justify laziness into efficiency. 1 Quote Link to comment Share on other sites More sharing options...
MikeP Posted May 16, 2011 Author Share Posted May 16, 2011 Sure "_:L" - excludes objects on Locked Layers from the SelectionSet "_non" - 'None' OSnap, i.e. ignore ObjectSnap for the next supplied point. thanks, but whats is the need to ignore those type of things? if you not asking for a base point. or is it just a safety to avoid any possible future errors? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 16, 2011 Share Posted May 16, 2011 i have a number of objects that I have to keep moving over 20". In my head I justify laziness into efficiency. Its definitely justified if the time taken to write the code is less than the time saved Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 16, 2011 Share Posted May 16, 2011 thanks, but whats is the need to ignore those type of things? if you not asking for a base point. or is it just a safety to avoid any possible future errors? I'm not prompting for a base point, but I'm still supplying the Move command with two points which may be affected by any objects surrounding those points. Quote Link to comment Share on other sites More sharing options...
MikeP Posted May 16, 2011 Author Share Posted May 16, 2011 cool thanks man. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 17, 2011 Share Posted May 17, 2011 My effort an oldie chx chy chz this is stuff 15 years old (defun C:CHX () (SETVAR "CMDECHO" 0) (setq sn (getvar "osmode")) (command "osnap" "near") (setq x 0) (princ "\nalters object in X direction") (setq ht (getstring "\n What is amount of change: ")) (setq newht (strcat ht ",0")) (while (= x 0) (setq newobj (entsel "\nPoint to object: ")) (if (/= newobj nil) (progn (command "move" newobj "" "0,0" newht) )) (if (= newobj nil)(setq x 1)) ) ) ; (defun C:CHY () (SETVAR "CMDECHO" 0) (setq sn (getvar "osmode")) (command "osnap" "near") (setq x 0) (princ "alters object in Y direction") (setq ht (getstring "\n What is amount of change: ")) (setq newht (strcat "0," ht)) (while (= x 0) (SETQ NEWobj (entsel "\nPoint to object: ")) (if (/= newobj nil) (progn (command "move" newobj "" "0,0" newht) )) (if (= newobj nil)(setq x 1)) ) ) ;simple routine to change objects in the z direction (defun C:CHZ () (SETVAR "CMDECHO" 0) (setq sn (getvar "osmode")) (command "osnap" "near") (setq x 0) (princ "alters object in Z direction") (setq ht (getstring "\n What is amount of change: ")) (setq newht (strcat "0,0," ht)) (while (= x 0) (SETQ NEWobj (entsel "\nPoint to object: ")) (if (/= newobj nil) (progn (command "move" newobj "" "0,0,0" newht) )) (if (= newobj nil)(setq x 1)) ) ) Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 17, 2011 Share Posted May 17, 2011 Quick Select and Move wouldn't work? How many times do you have to move the same objects 20"? What type of drawing is this? Quote Link to comment Share on other sites More sharing options...
edwinprakoso Posted May 23, 2011 Share Posted May 23, 2011 Fyi, In 2012 we can nudge object(s) using arrow. The distance can be determined using grid snap. Quote Link to comment Share on other sites More sharing options...
ADSK2007 Posted April 14, 2013 Share Posted April 14, 2013 Hello This is very usefull in my field as we design Shopping malls and use Architects drawings to quickly draw over their lines for what is needed in another location in model space then draw our own design over the traced lines. Is there a way to incorporate the pline command in Lee's lisp routine so the command first starts with Pline then automatically moves the object 20 in in left direction? Again we are not lazy cad users. it only removes the extra commands for each shape you draw (especially when you are tracing over a mall floor tiles) Best Regards Adsk2007 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.