PDA

View Full Version : Set drawing template as "default"



sinc
2004-09-17, 05:00 PM
Is it possible to set a drawing template as "default", so that if a layer is created in the current drawing and a layer by the same name exists in this "default" template, the new layer automatically takes its properties from the template?

It's possible to create a new drawing that contains all the layers in your template, but if you purge the drawing before putting something on a layer, you lose that layer. Then, if you later want to create an object on that layer, the only way I've found to get it like the template is to manually startup the layer translater, load the template, and do the conversion explicitly (or set color/linetype/lineweight manually, assuming you remember what they all are without refering to your template).

As an example, suppose I create surface EG1 in a new (purged) drawing. As I work with this surface, LDD will automatically create layers EG1-SRF-FLT, EG1-SRF-VIEW, EG1-CONT-MJR, and EG1-CONT-MNR. Unfortunately, all these automatically-created layers are white, with continuous lines using the "default" lineweight. I have layer settings for all these layers in my drawing template, and I'd like to be able to setup Autocad so that, as it creates the new layers, it automatically configures the layers to look like the ones in my "default" template.

I think I might be able to do this in Lisp, assuming I can setup a reactor to fire whenever a new layer is created, but I'm wondering if it's possible without the programming.

BrenBren
2004-09-17, 05:16 PM
Is it possible to set a drawing template as "default", so that if a layer is created in the current drawing and a layer by the same name exists in this "default" template, the new layer automatically takes its properties from the template?

It's possible to create a new drawing that contains all the layers in your template, but if you purge the drawing before putting something on a layer, you lose that layer. Then, if you later want to create an object on that layer, the only way I've found to get it like the template is to manually startup the layer translater, load the template, and do the conversion explicitly (or set color/linetype/lineweight manually, assuming you remember what they all are without refering to your template).

As an example, suppose I create surface EG1 in a new (purged) drawing. As I work with this surface, LDD will automatically create layers EG1-SRF-FLT, EG1-SRF-VIEW, EG1-CONT-MJR, and EG1-CONT-MNR. Unfortunately, all these automatically-created layers are white, with continuous lines using the "default" lineweight. I have layer settings for all these layers in my drawing template, and I'd like to be able to setup Autocad so that, as it creates the new layers, it automatically configures the layers to look like the ones in my "default" template.

I think I might be able to do this in Lisp, assuming I can setup a reactor to fire whenever a new layer is created, but I'm wondering if it's possible without the programming.
This may not answer all your questions, but what if you start each new drawing with your standard template. You can, in your options, default to a template drawing that you want to use every time you start a new drawing. When you use the QNew command, AutoCAD automatically opens this drawing. What happens if you have these layers eg1, srf, etc set up in your default template, open the default template and then start working?

sinc
2004-09-17, 08:16 PM
I think you misunderstand.

I have an existing drawing with a lot of stuff in it. It currently has no surface EG1, and is purged, so there are no EG1-* layers in the drawing (although there are a lot of other layers). We go out and do a topo survey, and I create a new surface in my existing drawing. In the course of this, the four EG1-* layers are created, all with color white, all with linetype continuous, all with lineweight "default". So, I have to manually use the layer translator to get the layers working the way I want.

I want this to be a general thing. I just happened to use surface-related layers as an example. If I have a layer "FOO" that I use regularly in my drawings, I'd like to be able to go into any drawing and create a layer "FOO" and have it look (by default) like the one in my template, WITHOUT having to run the layer translater. (Naturally, I could then change it to whatever I wanted, in violation of my standard, if I so chose. This using-the-template thing should only happen at layer creation.)

Actually, the more I explain it, the more I'm sure Autocad doesn't do this, and this is a wish-list item.

Is it clearer now?

Ed Jobe
2004-09-17, 08:36 PM
I have a utility to import page setups from a template. I was thinking about adding other things like layers, layouts, blocks, etc. Its on my to-do list. If you want to try it yourself, its on the Exhange. It has the basis for importing from a template. You just need to expand it to other objects. Or wait until I get to it myself. I don't have a schedule for it now, since I have a lot of work to get out. Maybe in a month from now I might get to it. When I get it complete, it would provide a one-click setup of older, pre-standard dwgs.

mjfarrell
2004-09-17, 09:07 PM
A way to do this would be to standardize your surface names
(looks like you have)
Put those in your template drawing.
Then, should they get purged, drag
them in using design center.

Mike.Perry
2004-09-17, 09:43 PM
Hi

Just to echo Michael's suggestion of using the AutoCAD Design Center, have a browse of the following threads -

custom design center (http://forums.augi.com/showthread.php?t=7995)

Autolisp help - inserting block names at startup (http://forums.augi.com/showthread.php?t=7512&highlight=Design+Center)

+

If the version of AutoCAD (LDT) you are running has Tool Palette functionality, it might be worth the time and effort to look at utilizing them (A search (http://forums.augi.com/search.php?) within the Forums will turn up a lot of good / useful information on Tool Palettes).

Have a good one, Mike

lpohlmeyer
2005-11-16, 02:57 PM
What I have done is create a dwg equivalent of my template. If I purge the dwg, all I have to do to get all the layers, dimstyles, textstyles, etc. back is insert the dwg equivalent. When it asks me for the insertion point, I cancel out of the command, so that it's not a block in my dwg. You could also write a script file to set these up and assign a button to run it, or drag/drop it to your dwg.

jaberwok
2005-11-16, 03:34 PM
If you insert one drawing into another the settings in the host drawing take precedence over the settings in the inserted drawing. So, you could insert your new drawing (not as a block) into your template and the colurs, linetypes, etc will be as defined in the template. You can then save that drawing over the original file.

sinc
2005-11-23, 03:42 PM
A way to do this would be to standardize your surface names
(looks like you have)
Put those in your template drawing.
Then, should they get purged, drag
them in using design center.
I do that regularly.

But for commands that create layers if they don't already exist, the layer must be manually inserted BEFORE it is created. Sure, I have all those layers in my template, but it's annoying carrying all the layers in a project through the course of the project - often 80% of them (or more?) go unused. But I need to retain them, just in case. Or I need to use Design Center to go get them manually.

It would be nice to not have to worry about this. For example, when I create an EG3 surface and start adding breaklines and generating contours, it would be nice if the EG3SRF-FLT, EG3SRF-CONT-MAJ, and EG3SRF-CONT-MNR layers all looked like my template, even if those layers are not already in the project, and without using Design Center or Layer Translator. This would give the ability to do things like create standard settings for commonly-used surfaces like EG1 through EG4 and FG1 through FG4 (5 layers per surface, if you also count the SRF-VIEW and SRF-BRD layers), without having 40 layers that may never be used just sit in all my drawings.

Opie
2005-11-23, 06:23 PM
You could do this a couple of ways. Depending on your abailities, you could create a lisp routine to create a new layer with the layer properties passed to it. Or you could create a script file that will create those layers. Either way you could also place a macro on a toolbar or menu item to execute either lisp or script.

I currently have a menu system that will allow me to create a new layer with predetermined settings. If you need help with something like that head on over to the programming forums (http://forums.augi.com/forumdisplay.php?f=88) and someone there can help you out.