Lock Commandline

Lock Commandline

SRSDS
Advisor Advisor
802 Views
4 Replies
Message 1 of 5

Lock Commandline

SRSDS
Advisor
Advisor

I think I'm having a problem with some people being too fast for my app to keep up with.

If they are slow it doesn't seem to be a problem but if they are hammering in commands AutoCAD crashes.

 

Does the comandline wait for instructions to be complete before starting the next?

Or is there a way to disable the commandline until a routine is finished?

 

Does doclock do this?

 

 

0 Likes
Accepted solutions (1)
803 Views
4 Replies
Replies (4)
Message 2 of 5

cjneper
Advocate
Advocate

Are you talking about a LISP program?  There is a delay/pause command that slows the program down to allow for user input.

0 Likes
Message 3 of 5

SRSDS
Advisor
Advisor

It's a Visual Studio app.

I do have a pallette that's a likely cause of the problem but I have spent a lot of time trying to making sure I cancel out of any active command before starting a new one.

I was wondering if the operations from the commandline are stalled (or stacked?) until the previous command has finished.

A script file seems to wait for the previous operation to complete so I assume it does.

 

0 Likes
Message 4 of 5

_gile
Consultant
Consultant
Accepted solution

Hi,

 

If the issue is related to the palette (i.e. a modeless UI), a simple and safe way should be callign custom command methods from the palette as recommended by Kean Walmsley's in this topic.:

"Once again there’s our important rule of thumb when it comes to implementing a modeless UI: rather than manually locking the current document, it’s safer to define a command – which will implicitly lock the current document – and call that from the UI via SendStringToExecute()."

Doing so, you let AutoCAD manage the commands stack.

 

You can find and example in this tutorial (palette section).



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 5 of 5

lena.talkhina
Alumni
Alumni

Hello @SRSDS !

 

Great to see you here on .NET Forum.

Did you find a solution?
If yes, please click on the "Accept as Solution" button as then also other community users can easily find and benefit from the information.
If not please don't hesitate to give an update here in your topic so all members know what ́s the progression on your question is and what might be helpful to achieve what you ́re looking for. 🙂

Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian

0 Likes