CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 9123
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How can AutoLISP deal with Dialog boxes?

 Post Reply Post Reply
Author
AndreasZ View Drop Down
Newbie
Newbie


Joined: 08.Jan.2024
Location: Germany
Using: AutoCAD 2013
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreasZ Quote  Post ReplyReply Direct Link To This Post Topic: How can AutoLISP deal with Dialog boxes?
    Posted: 08.Jan.2024 at 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 Confused.
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!


Edited by AndreasZ - 08.Jan.2024 at 22:40
Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 616
Post Options Post Options   Thanks (1) Thanks(1)   Quote Kent Cooper Quote  Post ReplyReply Direct Link To This Post Posted: 09.Jan.2024 at 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].
Back to Top
AndreasZ View Drop Down
Newbie
Newbie


Joined: 08.Jan.2024
Location: Germany
Using: AutoCAD 2013
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreasZ Quote  Post ReplyReply Direct Link To This Post Posted: 11.Jan.2024 at 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 Smile
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,344 seconds.