mehrdad Posted December 5, 2019 Posted December 5, 2019 Hi Expert, we have some A3 sheets of drawings in an autocad file, which are located beside each other with different distance and space on X axis. I need a lisp in a way that all those sheets could be beside each other on X axis with the same distance from each other. for example 10 mm for the space between of each. Thanks Quote
BIGAL Posted December 6, 2019 Posted December 6, 2019 Providing they have say a Title block or pline on individual layer around each then no problem all in one go. If Not then again a bit slower as you use bounding box around each window select. Have you thought about changing to layouts ? A much better way to work. Post sample dwg. Quote
mehrdad Posted December 6, 2019 Author Posted December 6, 2019 Yeah, I know what you meant, I'm aware of title blocks and their order ,but the thing that I need is the same space of each in X axis. Please find the attached file. 8-NG-001-F01-PT_Sht_1.dwg Quote
BIGAL Posted December 7, 2019 Posted December 7, 2019 As the dwg supplied is just all entities you would just window an area and move the objects to a new pt with a X spacing. If the title was a block much easier. Again an option may be to use layouts. Quote
BIGAL Posted December 7, 2019 Posted December 7, 2019 (edited) Have you cut and pasted multiple dwgs into one ? That's why I am getting funny results, if your going to do this then paste into a layout so much better way to handle the final dwg. So they are blocks in the dwg ? You have exploded 1 to make life confusing. Leave them as blocks no code required, when you paste just do so with points likes 0,0 0,500 0,1000 0,1500 make sure when you copy original pick base point lower left corner. 2nd method after 1 explode. ;; Selection Set Bounding Box - Lee Mac ;; Returns a list of the lower-left and upper-right WCS coordinates of a ;; rectangular frame bounding all objects in a supplied selection set. ;; sel - [sel] Selection set for which to return bounding box (defun LM:ssboundingbox ( sel / idx llp ls1 ls2 obj urp ) (repeat (setq idx (sslength sel)) (setq obj (vlax-ename->vla-object (ssname sel (setq idx (1- idx))))) (if (and (vlax-method-applicable-p obj 'getboundingbox) (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list obj 'llp 'urp)))) ) (setq ls1 (cons (vlax-safearray->list llp) ls1) ls2 (cons (vlax-safearray->list urp) ls2) ) ) ) (if (and ls1 ls2) (mapcar '(lambda ( a b ) (apply 'mapcar (cons a b))) '(min max) (list ls1 ls2)) ) ) (defun c:move-em2 ( / oldsnap pt pt2 pt3 xoff x yes) (setq oldsnap (getvar 'osmode)) (setq pt (Getpoint "\nPick a point as base point")) (setq xoff (getreal "\nEnter x offset ")) (setq Yes "") (setvar 'osmode 0) (while (= yes "") (setq pt2 (getpoint "\nPick lower left corner ")) (setq pt3 (getpoint "\npick upper right corner ")) (command "zoom" "e") (setq ss (ssget "W" pt3 pt2 (list (cons 0 "*line")))) (setq cnrs (LM:ssboundingbox ss)) (setq pt2 (nth 0 cnrs)) (setq pt3 (nth 1 cnrs)) (setq x (- (car pt3)(car pt2 ))) (setq pt3 (mapcar '+ pt3 (list 1.0 1.0 0.0))) (setq pt4 (mapcar '+ pt2 (list -1.0 -1.0 0.0))) (setq ss (ssget "W" pt3 pt4 )) (command "move" ss "" pt2 pt) (setvar 'osmode 1) (setq pt (mapcar '+ pt (list (+ x xoff) 0.0 0.0))) (setq Yes (getstring "\nPress Enter to continue any key to exit")) ) (setvar 'osmode oldsnap) (princ) ) (c:move-em2) Edited December 7, 2019 by BIGAL Quote
maratovich Posted December 7, 2019 Posted December 7, 2019 On 12/6/2019 at 1:02 PM, mehrdad said: Yeah, I know what you meant, I'm aware of title blocks and their order ,but the thing that I need is the same space of each in X axis. Please find the attached file. 8-NG-001-F01-PT_Sht_1.dwg 1.06 MB · 9 downloads Do you need like this? https://youtu.be/GsYc75VIATs 1 Quote
mehrdad Posted December 12, 2019 Author Posted December 12, 2019 Sorry for delay on response. Yes exactly, I need it .would you please help me with that? Thank you very much Quote
maratovich Posted December 12, 2019 Posted December 12, 2019 4 hours ago, mehrdad said: Sorry for delay on response. Yes exactly, I need it .would you please help me with that? Thank you very much Here is the link to the program: ReversVideo (how to use) in a previous post. Quote
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.