Display full version of the post: How can AutoLISP deal with Dialog boxes?

AndreasZ
08.01.2024, 22:36
Hi everyone,I want to automate a task using AutoLISP, but when I call "(command (AMPARTREF <Position>" etc..., a dialog box will pop up, interrogating me about some properties that I don't need .To get past that dialog, it seems I need to pass a <TAB> keystroke to AutoCAD. - Is there a way to do this - similar to "" meaning <ENTER> or (command()) meaning <ESC>?- Btw. the command AMPARTREF doesn't come with a hyphened variant (version is AutoCAD 2013).- Or can I somehow suppress the dialog with some setting? Thanks!
AndreasZ2024-01-08 22:40:38

Kent Cooper
09.01.2024, 18:05
(AMPARTREF) must be a custom function such as one built into an overlay program -- it's not part of regular AutoCAD.  So someone without that overlay program [like me] won't be able to try anything.  Generally, AutoLisp (command) functions won't take anything but native command names and their arguments, so this part:(AMPARTREF <Position> ....[with whatever follows] would need to feed back out to the (command) function an AutoCAD command name or input to such a command if you're already in it.  That would mean you can't get around whatever the (AMPARTREF) function needs you to do.  You would probably need to make an altered definition of the function without the asking for unneeded properties, or find another way to accomplish the task [I can't suggest anything without an idea what (AMPARTREF) does].

AndreasZ
11.01.2024, 21:04
Thank you for answering! Well the version I'm using is called "AutoCAD mechanical", maybe that's one of those overlay versions. "AMPARTREF" creates reference points that connects objects to the item list.In the meanwhile I found out that "CMDDIA" seems to turn of the dialog box, so I'm one step further... Wish me luck and have a nice day