Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

re inserting a standard base template for layering?

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
254 Views, 2 Replies

re inserting a standard base template for layering?

i'm in two minds about creating a lisp or pulldown with some standard features in it.

 

what i would like to do is be able to quickly insert a template (layers/linetypes/colours etc) which is the same used in our initial drawing. I'm a big fan of constantly purging and auditing my drawings to keep them clean and in a previous workplace we had the ability to reinsert all the default layering.

 

I originally thought it was a block with all the layers in it, does anyone know if a simple lisp routine would be the way to go? if yes, how would i go about it?

2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Here is what I use. (see attached)

 

What I did is used one of my templates and removed all of the objects leaving the layers, dimstyles, text styles, etc..

 

It will insert the block & then delete & purge it.

 

Change the path & block name to suit your needs. Dont forget the name of the block in the purge line.

 

(LAD) Layers & Dimensions

 

Rick

 

 

Message 3 of 3
scot-65
in reply to: Anonymous

Our office has a similar problem to where inserting a block containing

the default text styles, linetypes, layers, and dimension styles seems

to work, but then again it does not:

 

Assigned line type and/or color of an existing layer will not align to the

block "template" you are inserting. Layer1 has a linetype of Dashdot.

Layer1 in the template has a linetype of Dashdotx2. The template will

not change the destination drawing's linetype or color.

 

In the destination file, textstyle is "H1" is assigned to something other

than "H1.shx", but it is shown as true in the template. The destination

file will retain the relationship of H1 /= H1.shx.

 

Dimension style will not realign either.

 

There are two solutions here:

 

1) Make your block as a DWT file extension and insert the

destination file into this DWT, then do a Save As.

 

2) Our solution is a custom purge which does everything except the

purging of the layers. I also have a "Load Layers" routine that will

reinstall all the "currently recognized base layers" and will also realign

all the colors and linetypes of these base layers. I have even written

code that is buried in the menu functions that will realign a few existing

layers that might be out of alignment due to a older, somewhat abandoned

template that never gets updated, but is sometimes used by others here

in the office (I hate templates for this very reason).

 

;; Menu Function to load layers.
;; a = layer name  b = color  c = linetype
(defun LOAD_LAYER ( a b c / )
 (if (not (tblsearch "LAYER" a))
  (progn
   (setvar "CMDECHO" 0)
   (command ".layer" "New" a "Color" b a "Ltype" c a "")
   (setvar "CMDECHO" 1)
   (princ (strcat "\n Layer " a " created. "))
  );progn
 );if
 (setq a nil b nil c nil)(princ)
);endLOAD_LAYER

 

(LOAD_LAYER "Layer1" "7" "CONTINUOUS")

 

???

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost