OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Peter2 on November 13, 2014, 01:19:28 PM

Title: [Solved] Button-Event "onclicked" and "command insert ..."
Post by: Peter2 on November 13, 2014, 01:19:28 PM
I have a button which should insert a DWG to my current  drawing, using the
Quotecommand _insert Blockname=externalFileName

Here is the code
Code (autolisp) Select

(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:
Code (autolisp) Select
Command: ; Error: invalid AutoCAD command: nil

I tried every single line in AutoCAD, without 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
Title: Re: Button-Event "onclicked" and "command insert ..."
Post by: owenwengerd on November 13, 2014, 01:31:55 PM
What kind of dialog, and is the event firing synchronously or asynchronously (i.e. what is the button's Event Invoke property value)?
Title: Re: Button-Event "onclicked" and "command insert ..."
Post by: Peter2 on November 13, 2014, 02:08:08 PM
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
Title: Re: Button-Event "onclicked" and "command insert ..."
Post by: Peter2 on November 13, 2014, 02:22:18 PM
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.