I am trying to use LISP to open a drawing, and insert a block (purely for testing and learning purposes), however, I am receiving an error, and am not sure if I am approaching this in the correct way.
I am using the vla-open method, on the Documents Collection, then the vla-insertblock method on the ActiveDocument, as I understood that when the new drawing was opened, it then became the ActiveDocument.
This is a section of the code I am using:
(vla-open
(vla-get-Documents
(vlax-get-acad-object)) dwg :vlax-false)
(vla-insertBlock
(vla-get-ModelSpace
(vla-get-ActiveDocument
(vlax-get-acad-object)))
(vlax-3D-point '(0 0 0)) "test block" 1. 1. 1. 0.))))
Where "dwg" is just the filepath of a valid drawing name.
Any help and/or advice is appreciated as always,
Cheers,
Lee