ESC key in -LAYER command

ESC key in -LAYER command

JackTryMC
Contributor Contributor
441 Views
5 Replies
Message 1 of 6

ESC key in -LAYER command

JackTryMC
Contributor
Contributor

Hi, i've got problem with putting "escape key" between two commands. I generate name of layer and x y coordinates from excel. It looks like:

_.-LAYER _set nameofmylayer "here i want to brake command -layer  by escape and insert next command circle" 

_.circle x.,y. 2

 

^C^C, nil, #\ESCAPE etc doesn't work.

0 Likes
Accepted solutions (1)
442 Views
5 Replies
Replies (5)
Message 2 of 6

paullimapa
Mentor
Mentor

Why not just use extra spaces to represent enter to complete the layer command before starting another command?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 6

Kent1Cooper
Consultant
Consultant

Is this for a command macro, or in a Script file, or...?

 

Layer names can have spaces, so adding spaces could be problematic.  If it's a macro, ; is Enter, so try:

 

_.-LAYER _set nameofmylayer;;_.circle x.,y. 2

 

[But if the Layer name contains spaces, wrap it in double-quotes.]

 

If it's a Script file, try:

 

_.-LAYER _set nameofmylayer

 

_.circle x.,y. 2

 

with that blank line between the commands.

Kent Cooper, AIA
0 Likes
Message 4 of 6

JackTryMC
Contributor
Contributor

I want to "generate" this command in excel and paste directly to autocad command line box.

0 Likes
Message 5 of 6

paullimapa
Mentor
Mentor
Accepted solution

You can use lisp code

(command “_.-LAYER” “_set” “nameofmylayer” “” “_.Circle”)


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

Watch out for double quotes they can be left and right look real close at your post. using concatenate in excel may be helpful and char(34) for a dbl quote.

 

For JacktryMc are you looking at making more than 1 at a time then look at reading a csv file or read direct from excel. Solved: Lisp to add vertices to polyline - Autodesk Community - AutoCAD

 

 

 

 

0 Likes