I have a button which should insert a DWG to my current drawing, using the
Quotecommand _insert Blockname=externalFileName
Here is the code
(setq test_zieldatei "c:\\test\\test.dwg")
(defun c:test_haupt_btnDateiimport_OnClicked ( / )
(defun subroutine ()
(setq cmdecho_old (getvar "cmdecho"))
(command "_-insert" (strcat (vl-filename-base test_zieldatei) "=" test_zieldatei) nil)
(setvar "cmdecho" cmdecho_old)
(princ (strcat "\nVorlagedatei " test_zieldatei " wurde eingefügt."))
)
(subroutine)
)
The result is:
Command: ; Error: invalid AutoCAD command: nil
I tried every single line in AutoCAD, without OpenDCL:
- pure line (command "_-insert" ... works fine in AutoCAD
- pure "c:test_haupt_btnDateiimport_OnClicked" works fine in AutoCAD, but error within OpenDCL
- So I added the crazy "subroutine" and hoped that OpenDCL has no problems: now subroutine works fine in AutoCAD, but error within OpenDCL
So the basic question is:
How to insert a DWG with OpenDCL?
I found the function "dcl_InsertBlock", but it is listed as "outdated"...
Or to I have to close the dialog and open it again?
Thanks for your help
Peter
What kind of dialog, and is the event firing synchronously or asynchronously (i.e. what is the button's Event Invoke property value)?
It is a modeless dialog, and "Event Invoke" is "0".
(At the moment I have the same problem with a button_on_clicked with "(command"_line") -
AutoCAD command : nil
Quote from: Peter2 on November 13, 2014, 02:08:08 PM
...and "Event Invoke" is "0"...
I see, I see ... :-[ :-[ :-[ :-[
EventInvoke should set to "1" :-[
Have a nice day, Owen.