rustysilo Posted February 29, 2008 Posted February 29, 2008 What would the macro be (not necessarily lisp) for accepting or otherwise "clicking" the OK button of a dialogue box? Quote
Guest LElkins Posted February 29, 2008 Posted February 29, 2008 What exactly are you trying to acheive? Quote
rustysilo Posted February 29, 2008 Author Posted February 29, 2008 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. Quote
mahahaavaaha Posted February 29, 2008 Posted February 29, 2008 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 Quote
rustysilo Posted February 29, 2008 Author Posted February 29, 2008 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 Quote
mahahaavaaha Posted February 29, 2008 Posted February 29, 2008 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 Quote
rustysilo Posted February 29, 2008 Author Posted February 29, 2008 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. Quote
wizman Posted March 1, 2008 Posted March 1, 2008 insert in your macro file the alert function ex. ^C^C(ALERT "HELLO WORLD") Quote
rustysilo Posted March 2, 2008 Author Posted March 2, 2008 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? Quote
fixo Posted March 2, 2008 Posted March 2, 2008 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'~ Quote
Guest Alan Cullen Posted March 2, 2008 Posted March 2, 2008 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. Quote
Guest Alan Cullen Posted March 2, 2008 Posted March 2, 2008 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. Quote
Rooster Posted March 4, 2008 Posted March 4, 2008 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?? Quote
Guest LElkins Posted March 4, 2008 Posted March 4, 2008 look into EXPERT and add it to your script to supress these messages. Cheers Quote
Rooster Posted March 4, 2008 Posted March 4, 2008 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!!!! Quote
diverman241 Posted December 27, 2012 Posted December 27, 2012 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! Quote
neophoible Posted December 27, 2012 Posted December 27, 2012 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. Quote
diverman241 Posted December 27, 2012 Posted December 27, 2012 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. Quote
neophoible Posted December 27, 2012 Posted December 27, 2012 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. Quote
Recommended Posts
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.