We use paperspace for a lot of our sheet information. Whether its for Title block information, sheet numbers, keynote legends, plan titles or even general note information. And sometimes we'll have 1 to 20 layout tabs all contained inside this one drawing. So managing this information when revisions are made can be a pain. How much time alone has it taken you to cycle through 20+ layout tabs? It takes me a good amount of time. Each time you change layouts your viewports need to regenerate and depending on how much geometry or viewports this can get slow. There are some system variables you can use to help and we'll cover that in another post later.
So what do you do when you forgot to add a date field to you're title block information? Or forget to add the "NOT FOR CONSTRUCTION" note to you're drawings? Well you could create you're field and start opening each layout tab. Or you could use this simple code called COPY2LAYOUTS. COPY2LAYOUTS will actually prompt you to select any amount of objects from the current layout tab, build a selection set then apply those objects to each layout tab in your drawing. Using the same base point that objects from the first layout tab used. So you can get a bunch of information applied to all layout tabs with ease.
Click here to download the Lisp file Download copy2layouts.lsp
(defun c:copy2layouts (/ objects x layouts)
(setq objects (ssget))
(setq layouts (getvar "ctab"))
(command "_copybase" "0,0" objects "")
(command "erase" "p" "")
(foreach x (layoutlist)
(setvar "ctab" x)
(command "_pasteblock" "0,0")
(command "explode" "l" "")
)
(setvar "ctab" layouts)
(princ))
This looks like being very useful to me. I do similar tasks manually.
Could this be enhanced by having a routine that erased selected objects from all Layouts. i.e. When you want to remove the "NOT FOR CONSTRUCTION" text from all layouts. I would like to hear if it's possible.
Posted by: Greg | December 13, 2005 at 06:12 PM
This sounds possible. I will try and modify a bit to accommodate this. I'm not sure that you could select objects around the drawing. But you would be able to define a erase selection window? So you could crossing window over the text and it would omit it in all layout tabs? I will post that and see if this helps you out.
Posted by: Mark Douglas | December 13, 2005 at 07:17 PM
I don't work with layout tab at all but this is similar to my situation. If I have to edit sheet numbers for a set of drawings that have title blocks with identical attributes.
The sheets are labeled sheet 1 of 50, next sheet 2 of 50 etc... Each sheet is a separate file and has to be edited individually. How can I change the sheet from 1 of 50 to
1 of 51.
By adding one more sheet my total now is 51.
All drawing are setup with attributes and borders but scale size my be different.
Posted by: Sergio Pennica | December 15, 2005 at 05:47 AM
I'm not sure this is possible using Lisp, due to not being able to open and run additional code when opening drawings. But I have seen a VBA code that does this very thing. I will try and find the code.
Posted by: Mark Douglas | December 15, 2005 at 07:17 AM
Sergio:
We recently had a CADD meeting to address exactly that problem. What we decided on for the most efficient method was to have the border in each sheet be an xref to a file with nothing but the border in it. When you change your job's total number of pages from 50 to 51 you just go into the border dwg and alter the text and it updates on all the sheets, only one edit required. Of course there will always be text that is specific to the individual page such as the drawing scale or the sheet description so those will have to be text entities within the separate sheets and not in the xref dwg.
You can also put the individual sheet number in that xref border dwg as well using RTEXT to read the layout tab name, but I'm not sure if you are willing to name all your layouts "1", "2", "3", ... "49", "50". If you are, I can give you the macro for the RTEXT.
Hope this helps!
Posted by: Bill Roberts | January 06, 2006 at 10:40 AM
RE: Copy2layouts
Nice lisp routine, is there a way to only copy to selected, or named layouts begining with F (example Floor plan 1,2,etc...)
Posted by: Dan | February 08, 2006 at 11:36 AM
great routine - thanQ Mark!
Posted by: Nilesh Suchdev | July 16, 2006 at 12:08 PM
Mark,
In this article you said, "There are some system variables you can use to help and we'll cover that in another post later" referring to regeneration when moving between model tabs. Can you expound on this? On our slower systems, the wait can be painful.
Thanks in advance.
Phil Hinton
Posted by: Phil | August 31, 2006 at 09:00 AM
Mark,
In this article you said, "There are some system variables you can use to help and we'll cover that in another post later" referring to regeneration when moving between model tabs. Can you expound on this? On our slower systems, the wait can be painful.
Thanks in advance.
Phil Hinton
Posted by: Phil | August 31, 2006 at 09:07 AM
>"RE: Copy2layouts
>Nice lisp routine, is there a way >to only copy to selected, or >named layouts begining with F >(example Floor plan 1,2,etc...)"
(defun c:copy2layouts (/ objects x layouts)
(setq objects (ssget))
(setq layouts (getvar "ctab"))
(command "_copybase" "0,0" objects "")
(command "erase" "p" "")
(foreach x (layoutlist)
(if (or (= (substr x 1 1) "F") (= (substr x 1 1) "f"));;Add
(progn ;;Add
(setvar "ctab" x)
(command "_pasteblock" "0,0")
(command "explode" "l" "")
);;Add
);;Add
)
(setvar "ctab" layouts)
(princ))
Posted by: Rick Riggs | September 12, 2006 at 05:10 PM