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

Layer Description in Script file?

17 REPLIES 17
Reply
Message 1 of 18
Joe-Bouza
5233 Views, 17 Replies

Layer Description in Script file?

I'd like to add Layer descriptions , but I cannot seem to get out of the "D"escription option when the script runs so I get the some crazy descriptions. Is there a special key stroke to get to the next line to "M"ake a layer?

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
17 REPLIES 17
Message 2 of 18
balisteor
in reply to: Joe-Bouza

As far as i know you need to apply the description to the name after the layer has been made. so it prompts you for the name of  the layer to apply the description to.  basically needing to enter the layer name twice.

I'm not sure if  your just adding descriptions to current layers or adding new ones.

attach your script if you can. Thanks.

 

 

This seems to work for me for creating new ones

 

-layer
M
name
D
lyrdescription
name

-layer
M
name2
D
lyrdescription2
name2

 

 

 

And this one for existing layers

 

-layer
D
changeddescription
name
y



-layer
D
changeddescription2
name2
y


 

Message 3 of 18
hmsilva
in reply to: Joe-Bouza

Hi,

this is a sample scr to create a layer named "123", in color "3" and a description "test123", and a layer

named "456" in color "5" and a description "test456"...

 

layer
n
123
n
456
c
3
123
c
5
456
d
test123
123
d
test456
456

 

 

I hope it helps

 

Henrique

EESignature

Message 4 of 18
Joe-Bouza
in reply to: hmsilva

I guess this is my problem I'm creating a long list in Excel, concatanating then saving to SCR.

What I have been doing is adding the _layer to the top.

 

Could you give it a peak? Maybe you see the error of my ways.

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
Message 5 of 18
hmsilva
in reply to: Joe-Bouza

Hi,

found no error in the excel file,

if it is possible to post some lines from the scr file ..

 

Henrique

EESignature

Message 6 of 18
Joe-Bouza
in reply to: hmsilva

Thanks Henrique.

 

I notice I picking up some  random double quotes when I save  the excel to txt?

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
Message 7 of 18
hmsilva
in reply to: Joe-Bouza

Hi Joseph,

 

just removing the double quotes, and formatting your txt, it works fine.

 

Henrique

EESignature

Message 8 of 18
hmsilva
in reply to: Joe-Bouza

Joseph,
after some testing, I think the problem is solved.
you have to put \ U+000D (carriage return), after the layer description
and before the layer name, without spaces between them.
See the attached file, I did't change your configuration,
just add \+U000D

 

Hope that helps you...

 

Henrique

 

One more thing
if you need to create layers with spaces in name just place the layer name with double quotes:

layer
n "Concrete Walls" c 5 "Concrete Walls" d All Concrete Walls\U+000D"Concrete Walls"
n "Aluminum Windows" c 2 "Aluminum Windows" d All Aluminum Windows\U+000D"Aluminum Windows"
n "Aluminum Doors" c 1 "Aluminum Doors" d All Aluminum Doors\U+000D"Aluminum Doors"

 

Cheers

 

Henrique

EESignature

Message 9 of 18
hmsilva
in reply to: Joe-Bouza

Joe,
as you can see, using \U+000D in the concatenating formula, with no spaces between

(F3)&"\U+000D"&TRIM

such this

 ="N "&TRIM(B3)&" C "&TRIM(D3)&" "&TRIM(B3)&" LT "&TRIM(C3)&" "&TRIM(B3)&" D "&TRIM(F3)&"\U+000D"&TRIM(B3)

It works well

 
Got an error when you try to load a linetype that I have not “SANITARY”.
 

I think it is working well

See the attachments:


Cheers

Henrique

EESignature

Message 10 of 18
BIMAbhi
in reply to: Joe-Bouza

We can't see the layer description in the Layer Properties Manager DB after importing las file.

 

We have followed the below mentioned steps.

 

  1. We have created 3 no of layer in AutoCAD.
  2. Export the las file (A.las)
  3. Open another AutoCAD file
  4. Import the las file (A.las)
  5. Now we can't see the layer description in the Layer Properties Manager DB.

We have attached a snap for your reference.

 

Las File Contents:

  0
LAYERSTATEDICTIONARY
  0
LAYERSTATE
  1
A
 91
1023
301
Sample
290
0
302
0
  8
MEP
 90
8
 62
5
370
18
  6
Continuous
  2
Color_5
  8
Str
 90
8
 62
2
370
30
  6
HIDDEN
  2
Color_2
  8
Arch
 90
8
 62
1
370
5
  6
CENTER2
  2
Color_1
  8
0
 90
8
 62
7
370
-3
  6
Continuous
  2
Color_7

Thanks & Regards
BIMAbhi
Message 11 of 18
hmsilva
in reply to: BIMAbhi

RNDPIS,

in Layer Properties Manager, you can't export or import the layer description, this is none of the available properties... One possible  way, is with a script file. Attached is a .txt file [isn't possible to attach a .scr file], rename the file to .scr, and in a new dwg, type at the command line scr, and select the sript file, it will create the layers with all the settings including the descriptions, that you had in your example...

 

Hope that helps

Henrique

EESignature

Message 12 of 18
BIMAbhi
in reply to: hmsilva

Thanks for your valuable suggestion. It is a nice tips. Smiley Happy

 

But here we have to write the scr file. Is there any process to export the scr (as las export) file from a AutoCAD drawing including layer description so that we can import the scr file to another AutoCAD file as per our requirements.

 

Thanks again for your quick response.

Thanks & Regards
BIMAbhi
Message 13 of 18
hmsilva
in reply to: BIMAbhi

RNDPIS,
as I said

 

"in Layer Properties Manager, you can't export or import the layer description, this is none of the available properties... "

 

Another solution is,

 

Select all the layers in the layer manager, then to copy to clipboard, then paste into Excel. Then use a concatenating formula [see message 9] to create a scr.

 

Or a simpler way

 

Command: ADCENTER -> will open the Design Center, browse for the dwg which contains the layers, click in the layers to expand, select all the layers and drag to your dwg, it will create all the layers, with all the settings including the descriptions in your dwg...

 

Hope that helps
Henrique

EESignature

Message 14 of 18
BIMAbhi
in reply to: hmsilva

Thanks for your quick reply.

 

We have created a scr file and when we have executed the file then a list box (see the attach sample.png) wiil come.

Here we have attached the text file (instead of scr file)for your reference. Please rename it in .scr file.

 

 

 

Thanks & Regards
BIMAbhi
Message 15 of 18
hmsilva
in reply to: BIMAbhi

RNDPIS,
this is because the command was not terminated, after the last text line, you have to add two empty lines [enter, enter], to end the layer command

 

i.e.

n D c 158 D L HIDDEN D LW 0.13 D d DD\U+000DD
<- empty line
<- empty line

 

Henrique

EESignature

Message 16 of 18
BIMAbhi
in reply to: hmsilva

Thank you so much.Smiley Happy

Thanks & Regards
BIMAbhi
Message 17 of 18
hmsilva
in reply to: BIMAbhi

You're welcome, RNDPIS
Glad I could help

Henrique

EESignature

Message 18 of 18
imransiyal4621637
in reply to: BIMAbhi

Make your own layers in excel With script command and directly paste in autocadhttps://docs.google.com/spreadsheets/d/1FYgMsiDtIICqFnRWWBj5LpTmDvgtFy2r/edit?usp=drivesdk&ouid=1040... 

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

Post to forums  

Autodesk Design & Make Report

”Boost