-laydel Not working in script file

-laydel Not working in script file

Anonymous
Not applicable
1,709 Views
9 Replies
Message 1 of 10

-laydel Not working in script file

Anonymous
Not applicable

Hello all,

I have a create a small script file to run in Electrical project to do delete specific layer but it is not working for me.

I know i have made mistake in it and solution is there can u please help me?

find attached sample file for my script. for your info rename file format to ".scr".

0 Likes
Accepted solutions (1)
1,710 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable

hi,

 

where is the cad File, please  attach

 

 

Thanks and Regards,

Hari Nair [Master From Lost Nalanda]

Facebook|Youtube|Gmail

0 Likes
Message 3 of 10

Anonymous
Not applicable

hi,

 

filedia 0
-layer n Rev_cloud1
-layer c T 255,255,0 Rev_cloud1
-laydel n Rev_cloud1 y
filedia 1

 

Regards,

Thanks and Regards,

Hari Nair [Master From Lost Nalanda]

Facebook|Youtube|Gmail

0 Likes
Message 4 of 10

Anonymous
Not applicable

hi,

 

Try the Text.

 

Thanks and Regards,

Hari Nair [Master From Lost Nalanda]

Facebook|Youtube|Gmail

0 Likes
Message 5 of 10

Kent1Cooper
Consultant
Consultant

I can't help but wonder why you're making a new Layer and giving it a color, and then immediately getting rid of it.  I could understand making it first if  LAYDEL gives an error when you call for a non-existent Layer, but that doesn't explain giving it a color.  And it could be handled differently, checking whether it exists and then using LAYDEL only if it is in the drawing.

 

Anyway, @Anonymous 's suggestion appears to be accounting for the fact that Block names can have spaces in them  [there was a time when they couldn't, but it's been pretty long since they could, so you'd need to be in a rather old version for the space after the name to end it].

Kent Cooper, AIA
0 Likes
Message 6 of 10

Anonymous
Not applicable

 

Thank you for reply,

 

But when I run attached file it stuck here to ask select name of layer and not execute script to end.

Do I need to do  extra setting for run scripte file?

skypatel0503_1-1597386895947.png

 

0 Likes
Message 7 of 10

cadffm
Consultant
Consultant

Stop scripting, [edit: Stop your Try&Error to write a Script, do it step by step and you will solve the problem]

sitting in front of autocad do the workflow (only by using the keyboard) 

and write down all keystrokes.

If you like to confirm your input, use ENTER, not Space.

 

Follow the workflow until the command ended.

Then write it down as Script,

instead of ENTER, make a linebreak in your script.

 

Nothing less, nothing more.

 

 

After you run your script, press [F2] to see that all the worksteps working fine, or to see at which point it failed.

In the same time you will see what to fix.

Sebastian

0 Likes
Message 8 of 10

Anonymous
Not applicable
Accepted solution

hi,

 

try this

 

Thanks and Regards,

Hari Nair [Master From Lost Nalanda]

Facebook|Youtube|Gmail

Message 9 of 10

cadffm
Consultant
Consultant

@Anonymous wrote:

try this


My idea: Please test it yourself before you post it!

It is unnecessarily confusing if someone has problems sending them further incorrect answers.
(and I'm sure the scripts don't work for you either)

 

-Remove file, you don't need filedia in a script, useless

-Check the the part between the 2. and the 3. line, there is your first mistake

(note also: You don't need to exit the -layer command between New and Color setting)

- The second mistake is in line7, the is a blank where you don't need a blank.

 

Sebastian

0 Likes
Message 10 of 10

Anonymous
Not applicable

Great problem solved but I noticed one think.

Can you please tell why did you use "_N" instead of "N"?

Because in AutoCAD we press simple N in command line.

 

Thank you again

0 Likes