Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

_.-laydel

4 REPLIES 4
Reply
Message 1 of 5
morgeny
369 Views, 4 Replies

_.-laydel

Hello,

 

I am a newbie to AutoLISP and I need to write a program to delete all layers except for 0 after I start a new Civil 3D drawing.

I found a similar program and made some minor changes to it. It seems the program works fine, I just have a question about one line in that program,

 

(vl-cmdf "_.-laydel" "_N" name "" "_Y"))

 

Why put _ before N and Y? And the command is -laydel, why put _. before that command?

I guess this is probably a stupid question.

 

 

Thank you,

Xiangyu

 

4 REPLIES 4
Message 2 of 5
antoniovinci
in reply to: morgeny

It happens because the underscore sign lets the Lisp work even on non-english Autocad releases.

Why do you need such a routine, sir?

I think it would be easier to set up a template .DWT file having only the 0 layer, isn't it..?

Message 3 of 5
tcorey
in reply to: morgeny

(vl-cmdf "laydel" "N" name "" "Y")

 

works fine without the dashes and dots.

 

You have one-too-many right parens on your sample.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 4 of 5
rkmcswain
in reply to: morgeny

The underscore prefix allows for command translation.

Source: http://docs.autodesk.com/ACD/2014/ENU/files/GUID-D156B6ED-B1B4-42CB-BE1D-CA251BFC08C3.htm

 

The period prefix forces AutoCAD to use the core command and avoids any redefinition of the command name.

Source (last sentence): http://docs.autodesk.com/ACD/2014/ENU/files/GUID-38D0244E-C0C7-4FF0-A4B9-DE6E05635BD6.htm

 

 

R.K. McSwain     | CADpanacea | on twitter
Message 5 of 5
morgeny
in reply to: rkmcswain

Thank you very much!

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

Post to forums  

Rail Community


Autodesk Design & Make Report