
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I have only started learning to use LISP and it has been a bit of a learning curve. I have successfully made a program that inserts different blocks at different coordinates which increment. Now I want to change attributes in those blocks as they are inserted so I have gone from the simple block command to needing a vla object in which I can later use in a loop with 'getattributes. I have a block in the drawing called "myblock". When I run the following code, I get ; error: Exception occurred.
(defun c:vlaxtester (/ cur_pos blk testblock) (vl-load-com) (setq testblock "myblock") (setq cur_pos (vlax-3d-point 0 10000 0)) (setq blk (vlax-invoke (vlax-get (vla-get-ActiveLayout (vla-get-activedocument (vlax-get-acad-object))) 'Block) 'InsertBlock cur_pos testblock 1 1 1 0)) )
I have also tried calling the vlax-get function separately which works, and then incorporating it into the vlax-invoke function at which point it fails with the above general exception. I have been searching everywhere and see people using what looks like what i have above. I have tried the function insertion point as a 3 element list and the block name as the string "myblock"
Any help would be appreciated, I am feeling it is possible I am conceptually misunderstanding this.
Solved! Go to Solution.