Copy drawing to multiple drawings and rename layouts based on drawing name.

Copy drawing to multiple drawings and rename layouts based on drawing name.

Anonymous
Not applicable
375 Views
5 Replies
Message 1 of 6

Copy drawing to multiple drawings and rename layouts based on drawing name.

Anonymous
Not applicable

Hello,

 

I am trying to Copy a drawing. Rename the layout's of the drawing. Then delete the copied layout. (This includes my xref's and sheet templates).

 

I am copying a drawing called Site Plan.  Layout tabs copy over as Site Plan 1 and Site Plan 2. I want to change Site Plan 1 to Demolition 1 and Site Plan 2 to Demolition 2. The commands work, but it creates the layouts in the Site Plan Drawing. I want to be able to do it in the other drawings that are copied. Do I need to create a file path?

 

Here is what I got,

(defun C:CopyD ()
(command ".save" (strcat (getvar 'dwgprefix) "19000 DEMOLITION"))

(command "_-layout" "_rename" "" "DEMOLITION") // here is my problem

(command "_.layout" "Delete" "SITE PLAN 1") // here is my problem
(command "_.layout" "Delete" "SITE PLAN 2") // here is my problem

 

(command ".save" (strcat (getvar 'dwgprefix) "19000 HORIZONTAL CONTROL"))
(command ".save" (strcat (getvar 'dwgprefix) "19000 ROAD PROFILES"))
(command ".save" (strcat (getvar 'dwgprefix) "19000 GRADING AND DRAINAGE"))
(command ".save" (strcat (getvar 'dwgprefix) "19000 UTILITIES AND CONDUIT"))
(command ".save" (strcat (getvar 'dwgprefix) "19000 STRIPING AND SIGNAGE"))
(command ".save" (strcat (getvar 'dwgprefix) "19000 EROSION AND CONTROL"))
(command ".save" (strcat (getvar 'dwgprefix) "19000 DETAILS"))

);

0 Likes
376 Views
5 Replies
Replies (5)
Message 2 of 6

rl_jackson
Mentor
Mentor

Have you looked at Sheet Set Manager (SSM) it will probably do most of what you want based on your description. 


Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 3 of 6

Anonymous
Not applicable

I have, trying to automate this to be quicker. We get new projects everyday and if we can have a standardized template, it would benefit the office more ways than one.

0 Likes
Message 4 of 6

AllenJessup
Mentor
Mentor

My Lisp skills are very rusty. But I don't think you can affect a drawing that isn't open. I know they can be opened it the background but don't know how.

What you might try is creating the destination drawing and  using '-layout template' to bring the layout into the destination drawing and then renaming it.

There is also a Civil 3D Customization forum where you might get help.

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 5 of 6

Anonymous
Not applicable

Can I add this to my code?

 

(setq acApp (vlax-get-acad-object))
(setq acDocs (vla-get-documents acApp))
(command "_.OPEN" "P:\TROY LSIP TEST FOLDER\Design\Drawings\Sheet Drawings\19000 DEMOLITION")

or use

(command "_.FILEOPEN" "P:\TROY LSIP TEST FOLDER\Design\Drawings\Sheet Drawings\19000 DEMOLITION.dwg")

 

It still seems like its not working properly. What do you think would be a good way to do this? If I can open the drawings after they are saved, then I can edit the layers, sheets, tabs etc. This would be perfect. Please let me know!

0 Likes
Message 6 of 6

AllenJessup
Mentor
Mentor

Unfortunately I don't do that much lisp anymore. I'd suggest asking in the forum I linked. They will have a better idea on how to help you.

Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes