Jump to content

Needed much of a help


SCaldeira

Recommended Posts

Dear friends.

If I write in lisp (Command (alert "Hi Bob")), a message box will appear with a OK button.

How can I write in Lisp to click that button, without the mouse click or without pressing enter?

Thank you for your help.

With the Best regards.

Link to comment
Share on other sites

I don't understand why you would use (alert ) to display an alert box, only to dismiss it programmatically?

 

I don't think this is possible though, since the alert box takes focus until dismissed by the user, and multi-threading is not possible in AutoLISP.

Link to comment
Share on other sites

See the attached file.

Example.pdf

Greetings.

 

I don't understand why you would use (alert ) to display an alert box, only to dismiss it programmatically?

 

I don't think this is possible though, since the alert box takes focus until dismissed by the user, and multi-threading is not possible in AutoLISP.

Link to comment
Share on other sites

Are you doing a wblock ? try -wblock it helps a bit with filedia = 0 you need also a Alt+N keystroke for the No ALt+Y for Y this can be done pretty sure as an extend key just like the Alt text characters. Search here for ALT keys probably in lisp section may get you around user input. Any one help ALT+....

Link to comment
Share on other sites

BIGAL, you mean through the VBScript's SendKeys? Something like this:

(setq ws (vlax-get-or-create-object "WScript.Shell"))
(vlax-invoke ws 'SendKeys "%Y")
(vlax-release-object ws)

 

Edit: Fixed a small bug in my code. Sorry.

 

Even that's not going to work. Since lisp either sends the keys before opening alert, or only after alert's closed. So it doesn't help. Another alternative is to start the alert by sending the keys:

(progn
(setq ws (vlax-get-or-create-object "WScript.Shell"))
(vlax-invoke ws 'SendKeys "{(}alert \"Test\"{)}~")
(vlax-invoke ws 'SendKeys "~")
(vlax-release-object ws)
)

And yet that doesn't work either, since it's waiting for the alert to close before sending the next Enter. Even sending the 2nd enter in the same SendKey call does the same.

 

So unfortunately your only option would be to modify that C:Carto defun not to display the alert boxes.

Edited by irneb
Link to comment
Share on other sites

And yet that doesn't work either, since it's waiting for the alert to close before sending the next Enter. Even sending the 2nd enter in the same SendKey call does the same.

 

I don't think this is possible though, since the alert box takes focus until dismissed by the user, and multi-threading is not possible in AutoLISP.

 

I too investigated the SendKeys method for this... ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...