My Photo

May 2009

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

BLOGMap


« Attribute Setup | Main | Save, Close and Quit with Speed!! »

December 12, 2005

Copy Objects to ALL Layouts

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))

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8345ae08669e200d8349a73aa69e2

Listed below are links to weblogs that reference Copy Objects to ALL Layouts:

Comments

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.

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.

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.

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.

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!

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...)

great routine - thanQ Mark!

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

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

>"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))

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.