You are here:

AutoCAD/Make a Layer using a Command

Advertisement


Question
Hi Scott

You gave me the following Macro a little while ago:

^C^C(setvar "clayer" "layername")

It works very well, however what if I am working in a file that has not had the layer developed. Is there a Macro that will make the layer with the properties I want?

Answer
I typically put that info in a script, which is a text file with a .SCR extension.  Here is an excerpt from a script file that creates layers:

-LAYER
N ASB_PNTDES C 7 ASB_PNTDES
N ASB_PNTELV C 7 ASB_PNTELV
N ASB_PNTNO C 7 ASB_PNTNO
N ASB_POINTS C 7 ASB_POINTS
N BORDERPLINE C 21 BORDERPLINE LT DASHED BORDERPLINE


N makes a new layer, then the layer name, c for color, then the color value, then repeat the layer name, then LT if you want to assign a linetype, then a line type, then the layer name once more.

Save your script file somewhere in the support file search path with a .SCR extension, ie LAYERS.SCR

Then add the following to each macro you have already made:

^C^C(command "filedia" 0);(command "script");layers.scr;(command "filedia" 1 )  

Let me know if you have any further questions.

Scott Wilcox  

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scott Wilcox

Expertise

I have been using AutoCAD since R11, and can answer questions regarding general AutoCAD, menus, toolbars, fonts, linetypes, plotting, CUI, Some Civil 3D

Experience

18 years AutoCAD user (R11- R2010), AUGI Moderator

Organizations
AUGI

Publications
CADALYST

Education/Credentials
Instructor @ Alberta School of Drafting

©2012 About.com, a part of The New York Times Company. All rights reserved.