vla-insertblock not working

vla-insertblock not working

rajeshpatnaik2001
Advocate Advocate
601 Views
1 Reply
Message 1 of 2

vla-insertblock not working

rajeshpatnaik2001
Advocate
Advocate

Hi

 

The following code works fine to insert a block.

(command "-insert" blk_name "0,0" "1" "1" "0")

 

I am trying to write the same in visual lisp using the following code.

(vla-insertblock (vla-get-modelspace(vla-get-ActiveDocument (vlax-get-Acad-Object))) blk_name (vlax-3d-point 0 0 0) 1 1 1 0)

 

But it is showing an error:

; error: lisp value has no coercion to VARIANT with this type: #<variant 8197 ...>

 

What is wrong with my code??

 

Thanks.

 

0 Likes
Accepted solutions (1)
602 Views
1 Reply
Reply (1)
Message 2 of 2

rajeshpatnaik2001
Advocate
Advocate
Accepted solution

I found the issue, position of point and name of the block need to be interchanged.

The corrected code is 

(vla-insertblock  (vla-get-modelspace(vla-get-ActiveDocument (vlax-get-Acad-Object))) (vlax-3d-point 0 0 0) blk_name 1 1 1 0)

0 Likes