How to split multiple sheets in one layout to individual layout

How to split multiple sheets in one layout to individual layout

margono_bersinar
Enthusiast Enthusiast
3,069 Views
33 Replies
Message 1 of 34

How to split multiple sheets in one layout to individual layout

margono_bersinar
Enthusiast
Enthusiast

I have a many drawing from other people with no standard one sheet on one layout, now we on prosess to make As-built drawing 1000 drawing, any faster way or lsp to split multiple sheets in one layout to individual layout. we use xref title block. for lsp maybe this one similiar prosess publish multiple sheet on one layout.

0 Likes
Accepted solutions (1)
3,070 Views
33 Replies
Replies (33)
Message 21 of 34

margono_bersinar
Enthusiast
Enthusiast

thank you sir.

0 Likes
Message 22 of 34

Sea-Haven
Mentor
Mentor

Been on holidays will try to improve it a bit more like read layout name and number range. Move result to correct 0,0 position. Will add in a plot by range layouts program for you, handy in this case.

0 Likes
Message 23 of 34

margono_bersinar
Enthusiast
Enthusiast
This code is very useful, when as-built drawing come with big number drawing, always repeated in every project in my country. especially subcont has funny format drawing.
I was surprised in this forum no one ever asked this, is it only in my country that this problem occurs.
0 Likes
Message 24 of 34

Sea-Haven
Mentor
Mentor

It depends on the way companies work and to who you are providing a final solution, my projects were typically about 3-5 layouts, one was 88 layouts, some people just want all layouts in Model space, we used a 3rd party program every day so it produced individual layouts and we liked that way.

0 Likes
Message 25 of 34

margono_bersinar
Enthusiast
Enthusiast
for my company i think dificult to get 3rd party program because some drafter here for reduce budget only can use autocad lt. also here only few people know how to use lisp & bennefit using that one.
0 Likes
Message 26 of 34

Sea-Haven
Mentor
Mentor

Have a look at Bricscad possibly cheaper than LT and has lisp etc built in. It also has full lisp function unlike LT 2024+ which has a cut down version.

0 Likes
Message 27 of 34

Sea-Haven
Mentor
Mentor

Try this version it uses the global program Muti getvals for the dcl input, can be used in any code so make sure you save it in a support directory or add full path to the Load.

 

SeaHaven_0-1727581109819.png

;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-split-multiple-sheets-in-one-layout-to-individual-layout/td-p/13032412

; copy layouts
; BY AlanH SEP 2024

(defun c:copylays ( / oldsnap ss ss2 clay obj xsc ysc pt1 pt2 bname ins k x pt1 pt2 newname lay )
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)

(setq ss (ssget "X" (list (cons 0 "Insert")(cons 2 "TITLE BLOCK*")(cons 410 (getvar 'ctab)))))

(if (= lay nil)(setq lay 1))
(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq ans (AH:getvalsm (list "Enter values " "Layout number " 5 4 (rtos lay 2 0) "layout name  " 20 19 "-" )))
(setq lay (atoi (car ans)))
(setq layname (cadr ans))

(setq clay (getvar 'ctab))

(repeat (setq K (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq k (- K 1)))))
(setq ins (vlax-get obj 'insertionpoint))
(setq bname (vlax-get obj 'name))
(cond
((= bname "TITLE BLOCK_A2_R")(setq x 594. y 420.))
; add more sizes here 
)

(setq pt1 ins)
(setq pt2 (mapcar '+ ins (list x y 0)))
(command "copyclip" "W" pt2 pt1 (ssname ss k) "")
(setq newname (strcat layname "-" (rtos lay 2 0)))
(command "layout" "n" newname)
(setvar 'ctab newname)
(command "erase" (ssget "X" (list (cons 0  "viewport")(cons 410 (getvar 'ctab)))) "")
(command "pasteclip" "0,0")
(command "zoom" "e")
(setq ss2 (ssget "X" (list (cons 0 "Insert")(cons 2 "TITLE BLOCK*")(cons 410 (getvar 'ctab)))))
(setq obj (vlax-ename->vla-object (ssname ss2 0)))
(setq ins (vlax-get obj 'insertionpoint))
(setq pt1 (getvar 'extmin))
(setq pt2 (getvar 'extmax))
(command "move" "w" pt2 pt1 "" ins "0,0")
(setq lay (1+ lay))
(setvar 'ctab clay)
)

(setvar 'osmode oldsnap)
(alert "To run again type copylays ")
(princ)
)
(c:copylays)

 The layout number should auto increase when asked again or you can change, but can change description. Its not super fast as need to switch between layouts but at least you watch the flashing screen.

 

After running I would saveas, I have plot lisps etc that can be modified to suit your title block.

 

As I ended up with like 30 + layouts here is goto layouts allows you to do just that go to a layout by number.

0 Likes
Message 28 of 34

margono_bersinar
Enthusiast
Enthusiast

@Sea-Haven wrote:

Try this version it uses the global program Muti getvals for the dcl input, can be used in any code so make sure you save it in a support directory or add full path to the Load.

 

SeaHaven_0-1727581109819.png

 

;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-split-multiple-sheets-in-one-layout-to-individual-layout/td-p/13032412

; copy layouts
; BY AlanH SEP 2024

(defun c:copylays ( / oldsnap ss ss2 clay obj xsc ysc pt1 pt2 bname ins k x pt1 pt2 newname lay )
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)

(setq ss (ssget "X" (list (cons 0 "Insert")(cons 2 "TITLE BLOCK*")(cons 410 (getvar 'ctab)))))

(if (= lay nil)(setq lay 1))
(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq ans (AH:getvalsm (list "Enter values " "Layout number " 5 4 (rtos lay 2 0) "layout name  " 20 19 "-" )))
(setq lay (atoi (car ans)))
(setq layname (cadr ans))

(setq clay (getvar 'ctab))

(repeat (setq K (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq k (- K 1)))))
(setq ins (vlax-get obj 'insertionpoint))
(setq bname (vlax-get obj 'name))
(cond
((= bname "TITLE BLOCK_A2_R")(setq x 594. y 420.))
; add more sizes here 
)

(setq pt1 ins)
(setq pt2 (mapcar '+ ins (list x y 0)))
(command "copyclip" "W" pt2 pt1 (ssname ss k) "")
(setq newname (strcat layname "-" (rtos lay 2 0)))
(command "layout" "n" newname)
(setvar 'ctab newname)
(command "erase" (ssget "X" (list (cons 0  "viewport")(cons 410 (getvar 'ctab)))) "")
(command "pasteclip" "0,0")
(command "zoom" "e")
(setq ss2 (ssget "X" (list (cons 0 "Insert")(cons 2 "TITLE BLOCK*")(cons 410 (getvar 'ctab)))))
(setq obj (vlax-ename->vla-object (ssname ss2 0)))
(setq ins (vlax-get obj 'insertionpoint))
(setq pt1 (getvar 'extmin))
(setq pt2 (getvar 'extmax))
(command "move" "w" pt2 pt1 "" ins "0,0")
(setq lay (1+ lay))
(setvar 'ctab clay)
)

(setvar 'osmode oldsnap)
(alert "To run again type copylays ")
(princ)
)
(c:copylays)

 

 The layout number should auto increase when asked again or you can change, but can change description. Its not super fast as need to switch between layouts but at least you watch the flashing screen.

 

After running I would saveas, I have plot lisps etc that can be modified to suit your title block.

 

As I ended up with like 30 + layouts here is goto layouts allows you to do just that go to a layout by number.


 

thank you for update lisp sir.

 

multi getvals.lsp

margono_bersinar_0-1727664056821.png

that one only can add layout name on preffix sir? usually for my drawing i use number + name drawing.

 

goto layout.lsp 

i don't know what purpose off this lisp for split multiple sheets sir? or this one optional separate lisp for move to layout faster.

 

 

margono_bersinar_1-1727666644072.png

last one for viewport with some viewport freeze that one really can't do with this lisp sir? now i do manually block viewport one by one per sheet --> run the lisp --> explode manual on the new layout.

 

 

0 Likes
Message 29 of 34

Sea-Haven
Mentor
Mentor

Ok prefix

 

 

(setq newname (strcat layname "-" (rtos lay 2 0)))

(setq newname (strcat (rtos lay 2 0) "-" layname))

 

Not sure about vport freeze as I don't really know which viewports the layers are wrong can you explain which ones.

 

When you have say 30 layouts choosing to go say layout 35 means scrolling or choosing from a list. I had 88 layouts one dwg, so going to layout 72 was not straight forward. So I wrote "goto layout", I have it as an autoload so its loaded on start up if I need to go to layout 72 I type "goto" on command line, then put 72 in the box. 

SeaHaven_0-1727678084244.png

 

Just another I have "make a index" it reads attributes from your titles and places the details in a table, just ask if it may be helpful.

 

0 Likes
Message 30 of 34

margono_bersinar
Enthusiast
Enthusiast

Ok prefix

ok sir, already try & work perfectly.

 

Just another I have "make a index" it reads attributes from your titles and places the details in a table, just ask if it may be helpful.

yes sir, please share the lisp.

 

When you have say 30 layouts choosing to go say layout 35 means scrolling or choosing from a list. I had 88 layouts one dwg, so going to layout 72 was not straight forward. So I wrote "goto layout", I have it as an autoload so its loaded on start up if I need to go to layout 72 I type "goto" on command line, then put 72 in the box. 

i see, noted sir.

 

Not sure about vport freeze as I don't really know which viewports the layers are wrong can you explain which ones.

for example this ceiling drawing layer freeze you can see sir, original drawing ceiling layer tile is off but after copy & split that layer come out.

 

margono_bersinar_0-1727681017007.png

margono_bersinar_1-1727681218627.png

 

0 Likes
Message 31 of 34

Sea-Haven
Mentor
Mentor

Ok will look into it done as a manual task worked ok. Maybe linked to the way I select all the objects. 

0 Likes
Message 32 of 34

margono_bersinar
Enthusiast
Enthusiast

@Sea-Haven wrote:

Ok will look into it done as a manual task worked ok. Maybe linked to the way I select all the objects. 


is it possible sir, in the previous lisp, before the copyclip command we create a block first, then paste it into the new layout then explode it. previously I searched for lisp in the forum there is a lisp to create automatic block names attached below. 

0 Likes
Message 33 of 34

Sea-Haven
Mentor
Mentor

What is dwg number ? Can not read image.

0 Likes
Message 34 of 34

margono_bersinar
Enthusiast
Enthusiast
that image above is number 14 sir.
0 Likes