dreams Posted August 28, 2012 Share Posted August 28, 2012 Can i have lisp routine for Move Objects with specific distance (10" Inches)(-Y axis ) from selected point? Quote Link to comment Share on other sites More sharing options...
Dadgad Posted August 28, 2012 Share Posted August 28, 2012 Having seen a quite similar request in the SIMILAR THREADS box, it certainly looks like this lisp of Lee's from the other thread could be made to work for you by adjusting the X & Y values highlighted in yellow. Replace the -20 in the X field with 0. and the Y value with -10, and I am guessing you should be good to go. Quote Link to comment Share on other sites More sharing options...
dreams Posted August 28, 2012 Author Share Posted August 28, 2012 Thanks Dadgad... Having seen a quite similar request in the SIMILAR THREADS box,it certainly looks like this lisp of Lee's from the other thread could be made to work for you by adjusting the X & Y values highlighted in yellow. Replace the -20 in the X field with 0. and the Y value with -10, and I am guessing you should be good to go. Yes..I had checked with Lee's lisp with changing Y value but I need to move objects from selected point with distance.. I am not familiar with visual lisp... Can i have any suggestion to edit that lee's lisp...? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 28, 2012 Share Posted August 28, 2012 Yes..I had checked with Lee's lisp with changing Y value but I need to move objects from selected point with distance.. The point from which the displacement is measured is irrelevant, you would receive the same result for any base point in the drawing. Quote Link to comment Share on other sites More sharing options...
dreams Posted August 28, 2012 Author Share Posted August 28, 2012 The point from which the displacement is measured is irrelevant, you would receive the same result for any base point in the drawing. Thanks Lee...I got your point but I want to move selected objects with distance to another location that where I have to pick point (New location)... Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 28, 2012 Share Posted August 28, 2012 (edited) Things like this ? (defun c:Test (/ ss p1 p2) (if (and (setq ss (ssget "_:L")) (setq p1 (getpoint "\n Specify base point :")) (setq p2 (getpoint "\n Specify New base point :" p1)) ) (progn (command "_.move" ss "" "_non" p1 "_non" p2) (command "_.move" ss "" "_non" p1 "_non" (polar p1 (* pi 1.5) (* 25.4 10.))) ) (princ) ) (princ) ) Edited August 28, 2012 by Tharwat Quote Link to comment Share on other sites More sharing options...
dreams Posted August 28, 2012 Author Share Posted August 28, 2012 Hi Tharwat...Its working fine...but I expected objects to be move in -Y axis (ie. Below picked point)...Is it possible to modify your lisp? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 28, 2012 Share Posted August 28, 2012 hi tharwat...its working fine...but i expected objects to be move in -y axis (ie. Below picked point)...is it possible to modify your lisp? codes updated Quote Link to comment Share on other sites More sharing options...
dreams Posted August 28, 2012 Author Share Posted August 28, 2012 Thanks Tharwat..Its working very fine what i expected...This lisp will reduce my lot of working time...Thanks again... Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 28, 2012 Share Posted August 28, 2012 You're very welcome . Quote Link to comment Share on other sites More sharing options...
mihaibantas Posted January 31, 2017 Share Posted January 31, 2017 Hi all, I tried to modify lisp above ... I want to sit 4 sets of objects in the following scheme. 1 2 3 4 to 1 3 2 4 where am I wrong ??? Thank you for your time. (defun c:test ( / p1 p2 p3 p4 ss ) (if (and (setq ss (ssget "_:L")) (setq p1 (getpoint "\Point for Basepoint1: ")) (setq p2 (getpoint "\Point for Basepoint2: ")) (setq p3 (getpoint "\Point for Basepoint3: ")) (setq p4 (getpoint "\Point for Basepoint4: ")) ) (progn(command "_.move" ss "" "_none" p1 "_none" '(25.00 166.00 0.00) "_none" p2 "_none" '(25.00 45.00 0.00) "_none" p3 "_none" '(217.50 166.00 0.00) "_none" p4 "_none" '(217.50 45.00 0.00) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 31, 2017 Share Posted January 31, 2017 You will need to invoke the MOVE command for each move operation. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 1, 2017 Share Posted February 1, 2017 Depending on the objects an alternative would be pick lower left, hor space, ver space. This would be applicable for blocks text etc or as per a recent post using a bounding box. You can then have grid combos 2x2 2x3 etc. Quote Link to comment Share on other sites More sharing options...
mihaibantas Posted February 1, 2017 Share Posted February 1, 2017 Hello Lee Mac, Firstly I want to thank you for the answers given. I tried to invoke the MOVE command in the above code ... I do not know where I'm wrong. Attached you will find my attempt to introduce give command MOVE. (defun c:test ( / p1 p2 p3 p4 ss ) (if (and (setq ss (ssget "_:L")) (setq p1 (getpoint "\Point for Basepoint1: ")) (setq p2 (getpoint "\Point for Basepoint2: ")) (setq p3 (getpoint "\Point for Basepoint3: ")) (setq p4 (getpoint "\Point for Basepoint4: ")) ) (progn (command "_.move" ss "" "_none" p1 "_none" '(25.00 166.00 0.00)) ;want to move Basepoint1 in x, y coordinate 25.00, 166.00 (command "_.move" ss "" "_none" p2 "_none" '(25.00 45.00 0.00)) (command "_.move" ss "" "_none" p3 "_none" '(217.50 166.00 0.00)) (command "_.move" ss "" "_none" p4 "_none" '(217.50 45.00 0.00)) ) ) (princ) ) Here's some pictures of what I want to do. and finally selected objects to place in positions x, y wanted Thank you in advance for your cooperation. I wish you a good day. Quote Link to comment Share on other sites More sharing options...
mihaibantas Posted February 1, 2017 Share Posted February 1, 2017 Hello Lee Mac and BIGAL Firstly I want to thank you for the answers given. Lee Mac i tried to invoke the MOVE command in the above code ... I do not know where I'm wrong. Attached you will find my attempt to introduce give command MOVE. BIGAL i want to move objects such as lines, polylines and text blocks. (defun c:test ( / p1 p2 p3 p4 ss ) (if (and (setq ss (ssget "_:L")) (setq p1 (getpoint "\Point for Basepoint1: ")) (setq p2 (getpoint "\Point for Basepoint2: ")) (setq p3 (getpoint "\Point for Basepoint3: ")) (setq p4 (getpoint "\Point for Basepoint4: ")) ) (progn (command "_.move" ss "" "_none" p1 "_none" '(25.00 166.00 0.00)) ;want to move Basepoint1 in x, y coordinate 25.00, 166.00 (command "_.move" ss "" "_none" p2 "_none" '(25.00 45.00 0.00)) (command "_.move" ss "" "_none" p3 "_none" '(217.50 166.00 0.00)) (command "_.move" ss "" "_none" p4 "_none" '(217.50 45.00 0.00)) ) ) (princ) ) Thank you in advance for your time. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 2, 2017 Share Posted February 2, 2017 Moving multiple objects will be a bit more difficult but can be done using "Group" or individual selection sets if you have say 1 lot of lines, 1 text, 1 block, and line/arcs etc the easiest way would be to multiple pick the 4 selections, looking for gaps in one big selection would require a lot more coding. Back to my lower left and hor and ver. Pick group 1, pick group 2 etc all done. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 3, 2017 Share Posted February 3, 2017 Had another think about this we just draw temporary grid lines and move objects. Quote Link to comment Share on other sites More sharing options...
mihaibantas Posted February 3, 2017 Share Posted February 3, 2017 Hi all, I managed to make my code to bring the four frames in the desired points .... thank you for the advice given. code has the following operations: select items first frame > select the point where the objects of first frame to be moved ... and keep operations up to four frame. (defun c:test ( / p1 p2 p3 p4 ss1 ) (if (and (setq ss1 (ssget "_:L")) (setq p1 (getpoint "\Point for Basepoint1: ")) (setq ss2 (ssget "_:L")) (setq p2 (getpoint "\Point for Basepoint2: ")) (setq ss3 (ssget "_:L")) (setq p3 (getpoint "\Point for Basepoint3: ")) (setq ss4 (ssget "_:L")) (setq p4 (getpoint "\Point for Basepoint4: ")) ) (progn (command "_.move" ss1 "" "_none" p1 "_none" '(25.00 166.00 0.00)) (command "_.move" ss2 "" "_none" p2 "_none" '(25.00 45.00 0.00)) (command "_.move" ss3 "" "_none" p3 "_none" '(217.50 166.00 0.00)) (command "_.move" ss4 "" "_none" p4 "_none" '(217.50 45.00 0.00)) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Grrr Posted February 3, 2017 Share Posted February 3, 2017 For that particular example I think: Initially create the sorted pointlist: (list '(25.00 166.00 0.00) '(25.00 45.00 0.00) '(217.50 166.00 0.00) '(217.50 45.00 0.00) ) Prompt for a single selection of rectangle-LWPolylines For each LWPolyline look for a object with TextString, wcmatching to "#" Get BBOX for each LWPolyline For the list of ( ) sort the list by the numerical TextString For each point of the pointlist, Move the SS from its lower-left bbox point to the corresponding point Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 3, 2017 Share Posted February 3, 2017 I agree Grr see my post #12 bounding box still think pick lower left, pick right, pick up, do we really need to hard code the points shift use (getdist pt1 "next point') etc can still type a number if required. 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.