You are here:

AutoCAD/LSP routine running another LSP routine that requires input.

Advertisement


Question
I'm trying to use the Layer isolate command within a LSP routine, and then want the next user input to be "LAST", rather than to actually wait for user input...  How do I make this happen....  [I may not see your response unless you copy answer to my e-mail address--- THANKS IN ADVANCE]

In my LSP routine, I have
.
.
(C:LAYISO)
? ??? ---- next line syntax  ??? or add to the previous line ???

Answer
It is not possible for a lisp routine to 'answer' a prompt from another. This is because when you are in the (c:layiso) function, that is all that is running. The calling function is waiting for it to complete.

There are 2 ways to do what you want: 1. Do it from a menu macro. This will allow you to enter the last you want.
2. Steal the relevant code from inside the LAYISO routine, and modify it not to prompt, and instead use an (entlast) or whatever in the code where the prompt occurs.

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scott Cook

Expertise

I`ve been using AutoCAD since 1987 and programming AutoLISP nearly as long. I can answer questions about programming AutoCAD (except ARX) and production enhancement techniques. I cannot answer questions about AutoCAD crashes or DWG corruption. AutoCAD PROGRAMMING (menus, lisp) related questions only!

Experience

Since 1987. Author of Plot2000 software for for AutoCAD, http://www.plot2000.com. PROGRAMMING QUESTIONS ONLY PLEASE. Questions that are NOT related to programming or AutoCAD customization (menus and lisp only please) are outside the scope of my volunteer services and will NOT BE ANSWERED.

©2012 About.com, a part of The New York Times Company. All rights reserved.