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
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..?
(vl-cmdf "laydel" "N" name "" "Y")
works fine without the dashes and dots.
You have one-too-many right parens on your sample.
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