Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creation of layers script file

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
6880 Views, 6 Replies

Creation of layers script file

Afternoon guys (and gals),

 

I am trying to set up 400+ layers for a project I am currently woirking on and the wayI have been told to do this is through a script file.

 

I have created this but whenever I run it, the description will not show in Autocad 2013 - an extract from the scr file is below and I would love to find a solution or a fix to any error???

 

'-LAYER
N W-51CD-SEZE------------ C red W-51CD-SEZE------------ LT continuous W-51CD-SEZE------------ D DRAINAGE - EXISTING GRAVITY PIPE (PLAN/PROFILE/MODEL)

 

Many thanks in advance

6 REPLIES 6
Message 2 of 7
hmsilva
in reply to: Anonymous

Welcome to the Autodesk Forums, mart.

 

try:

LAYER

N W-51CD-SEZE------------ C red W-51CD-SEZE------------ LT continuous W-51CD-SEZE------------ D DRAINAGE - EXISTING GRAVITY PIPE (PLAN/PROFILE/MODEL)\U+000DW-51CD-SEZE------------

<<<empty line>>>

<<<empty line>>>

 

affter the description you'll need to use \U+000DW (carriage return) and then the layer name.

 

Not tested...

Hope that helps

Henrique

EESignature

Message 3 of 7
Ajilal.Vijayan
in reply to: Anonymous

Or in the Script file use this format.

 

After the description text use a New line

 

-layer M NewLay01 C 3 NewLay01 L dashed2 NewLay01 LW 0.05 NewLay01 D Mylayer
NewLay01 plot plot NewLay01

 

Message 4 of 7
pendean
in reply to: Anonymous

If I may suggest an alternate method or two...

1. Create all your layers (and everything else you need) in a TEMPLATE file: start with it when you need a new file, INSERT existing files into the TEMPLATE then SAVEAS to create a ready to go file.

2. ADCENTER command can also let you drag/drop layers from exisitng files into your current file.
Message 5 of 7
Anonymous
in reply to: Anonymous

Thanks for the responses guys, I have tried the following and can run the script file but this still leaves the descriptions blank 😞

 

LAYER N W-51CD-SEZE------------ C red W-51CD-SEZE------------ LT continuous W-51CD-SEZE------------ D DRAINAGE - EXISTING GRAVITY PIPE (PLAN/PROFILE/MODEL)\U+000DW-51CD-SEZE------------

<<<empty line>>>

 

Anyone any idea what I could do???  (I would like to use this script file as there are so many layers to create - editing them manually will be time consuming)

Message 6 of 7
Ajilal.Vijayan
in reply to: Anonymous

Above mentioned script works for me.

 

Finish.JPG

 

 Also I guess the tick mark of Description tab in the Layer box is ON

 

 

Press F2 after the script finished and check the output window results with the attached image.

 

Run.JPG

Message 7 of 7
Anonymous
in reply to: Anonymous

Do you have a Layer State Export File or sample drawing with all of the layers already setup? I've been converting my "clean and restore" lisp into a script for a button and use a LAS file in the lisp. It's taken a bit of trial and error but I eventually got it to work. I added the requirement to delete the layer state because it won't import if it exists in the drawing when importing.

I think that if you already have a DWG or LAS with all of the layers setup then you could do it this way with the button

This is the text used:

-layer;a;d;<Layer state>;i;"<LAS file>";r;<Layer state>;;;

#edit Sorry I've just realised I'm necroing an old post *facepalm*

 

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

Post to forums  

Forma Design Contest


Autodesk Design & Make Report