So I designed a Button in DCL and it displays fine. However, I am trying to program it in Autolisp that when I click on the button, it will open a file in my computer. My code is:
I do not know what is the proper way to pull up a command from autocad. Since you have to use quotation, and we have to use another quotation for the command.
Here is a quick example for you to play with:
[code];; Open File Example - Lee Mac;; www.cadtutor.net/forum/showthread.php?97521(defun c:myopen ( / dch dcl des idx lst rtn ) (defun *error* ( msg ) (if (and (= 'int (type dch)) (
Thanks Lee Mac,
I do not know if the last reply went out or not.
But this is a brilliant program.
However, for my program specifically,
I already know what file I wanted to open before I click the button,
since I already sorted the options out from former menus.
Thus, I just need to open a certain dwg file in the certain location.
As per my example above, you should evaluate the expression to open your file outside of the action_tile statement for your dialog tile, and after the dialog has been dismissed.
Since DCL dialogs are modal, AutoCAD cannot take focus whilst the dialog is displayed and will therefore freeze if attempting to evaluate a command without first dismissing the dialog.