2014-11-13 21:19 UTC
I have a button which should insert a DWG to my current drawing, using the
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:
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
command _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