Jump to content

Recommended Posts

Posted

What would the macro be (not necessarily lisp) for accepting or otherwise "clicking" the OK button of a dialogue box?

Posted

I'm creating a toolbar which calls a lisp file and at the end the lisp initiates a pop-up dialog. I need the code for my toolbar to accept and dismiss the pop-up dialog so I can add to my macro and run other commands.

Posted

I think you'd be best off learning VBA:

 

Sub YeaNo()

Dim Answer As String

response = MsgBox("What say; YOu or NAy?", vbYesNo)

If response = Yes Then

Answer = Yes

Else

Answer = No

End If

End Sub

Posted

But all I need to know is how to dismiss this dialogue box. A macro/string of text that would essentially = clicking OK, Esc, or Enter

Posted

Oh you mean there is a dialog Yes/No that comes from an AUtoCAD Command that you'd like to by-pass? Try EXPERT?

 

/Petri

Posted

Well it's simply an alert box with an OK button that's part of a lisp file, but more or less the same sort of deal I guess.

I just removed that part from the lisp file so I don't have to figure this out, although it would still be nice to know for future reference.

Thanks.

Posted

insert in your macro file the alert function

ex.

 
^C^C(ALERT "HELLO WORLD")

Posted

No. I don't want to know how to create the alert box. I want to know how to dismiss one. What is the code to dismiss an alert box that pops up as a result of a previous function within the macro coding? Is there a macro code that will do this?

Posted
No. I don't want to know how to create the alert box. I want to know how to dismiss one. What is the code to dismiss an alert box that pops up as a result of a previous function within the macro coding? Is there a macro code that will do this?

 

Take a look at system variable EXPERT

 

Setting EXPERT can affect scripts, menu macros, AutoLISP, and the command functions.

 

~'J'~

Guest Alan Cullen
Posted

Dunno. Maybe ^C^C will do it. I know nothing about macros, and don't profess to know anything about them.

 

I once came across all the macro commands available, and I thought we had that in the FAQ, but a quick search tells me we left that out.

 

I would suggest doing a search in acad help, because that is where I found it all. I know that is not a real good answer, but trust me on this, I found it there. Just use different search terms, like Macro, etc.

Guest Alan Cullen
Posted

At the risk of getting howled down by the knowegible members here, I have done a hunt back through my records, and this is the best I could come up with. I think the original search was done in 2008, I only have 2007 here at home, so I scanned what I have. Hope it suits.

 

macro1.jpg

 

macro2.jpg

Posted

I've got a similar problem to rustysilo:

 

I use a script that does a multi-pedit. The problem is that quite often I run this on a drawing where there are a lot of lines that I want pedited together (typically 5000+), and here the script fails because of an alert about 'this operation may take a long time' & something about disregarding Draw Order. Is there any way I can get my script to accept this alert??

Guest LElkins
Posted

look into EXPERT and add it to your script to supress these messages.

 

Cheers

Posted

I have looked at EXPERT, and it doesn't help me....

 

...but I have since also looked at DRAWORDERCTL which allows me to turn DRAW ORDER off, so I can add this to my script, and I think this gets me around the problem. YAY!!!!

  • 4 years later...
Posted

Has there been any update in new CAD releases that would give an answer to this questions? I'm working with an add-on to CAD and many times it will prompt a dialog which options and an "OK" and "Cancel". Often I don't change any options and just click the "OK", but it'd be great if there was a way to have this automated in a macro. I just learned some basic lisp language, and can integrate this into the macro if that's a work-around. TIA!

Posted

It’s an interesting problem, but it might be better addressed if you shared more about the dialog you are dealing with. Also, what have you already tried that didn’t work? Dialogs can be suppressed, as mentioned above, but would have to happen before the dialog popped up, and not be prematurely reset by your add-on! And since you do not always want to simply dismiss the dialog, it sounds like you will need two versions of your macro and then remember to choose the correct one.

Posted

The dialog is preset to pop-up in the add-on, so my questions is really about dismissing the dialog once it is open. The dialog is accessible within the menus, so I wont need two macros, just the one that dismisses. I have tried the ^I for tab and ^M for enter in the macros and haven't gotten CAD to process any of these until after the dialog as been addressed. Someone in another forum had mentioned DIESEL macros, but I'm not sure I understand their use in this situation.

Posted

Well, without knowing more about the function and use, it’s hard for me to visualize what is particularly difficult. Most dialogs I’ve encountered can be dismissed with a quick press of Esc, which for me is about as quick as it gets. Of course, if I knew more about it, it is not likely that I would have a better answer. As far as I have seen, once a dialog gets started, it has control until the user dismisses it somehow, which is generally the purpose, much like a pause in a macro. If a program does not have a switch to suppress dialogs, and it insists on opening one, then a quick Esc is the only option I know of. But I’m far from having seen it all, and I sure don’t know it all.:o

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...