Hello, and Happy New Year to those east of me!
I have a modeless form with an OptionList. As each option is pressed I want to insert different blocks into the drawing.
Using Modeless.lsp as a guide I used this code:
(defun c:bTscore/Form1/key#OnSelChanged (ItemIndexOrCount Value /)
(dcl-Form-Enable bTscore/Form1 nil)
(c:test)
(dcl-Form-Enable bTscore/Form1 T)
)
If I use,
(defun c:test ()
(command "_insert" "block1" '(0 0 0) 1 1 0)
)
I get the following error: ; error: invalid AutoCAD command: nil
And if I use,
(defun c:test ()
(entmake '((0 . "INSERT") (100 . "AcDbEntity") (8 . "0") (62 . 250) (100 . "AcDbBlockReference") (2 . "block1") (10 0.0 0.0 0.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0)))
)
AutoCAD crashes with a fatal error.
What am I doing wrong?
Hi,
Close AutoCAd then change the property of EventInvoke to 1-Asynchronous to the button or the tool you use to insert the block.
I hope this would work.
Worked like a charm, thanks!
Quote from: ScottBolton on December 31, 2015, 11:27:12 AM
Worked like a charm, thanks!
Nice, you are welcome.
Happy to help for sure. :)