bababarghi Posted June 2, 2016 Posted June 2, 2016 Folks, can someone plz tell me why I get ; error: Automation Error. Object permanently erased error? (defun test () (vl-load-com) (setq acad1 (vlax-get-acad-object)) (setq doc1 (vla-get-ActiveDocument acad1)) (setq ps (vla-get-PaperSpace doc1)) (setq ValidBlockName (findfile "...MY BLOCK FULL PATH.." ) ) (setq blk (vla-InsertBlock ps (vlax-3d-point '(0.0 0.0 0.0)) ValidBlockName 1.0 1.0 1.0 0.0 ) ) (princ) ) (test) Quote
BIGAL Posted June 3, 2016 Posted June 3, 2016 Maybe why (setq blk ? The insert works without the setq Quote
bababarghi Posted June 3, 2016 Author Posted June 3, 2016 (edited) Maybe why (setq blk ? The insert works without the setq Nope. setq wasn't the issue. Any other idea? (defun test () (vl-load-com) (setq acad1 (vlax-get-acad-object)) (setq doc1 (vla-get-ActiveDocument acad1)) (setq ps (vla-get-PaperSpace doc1)) (setq ValidBlockName (findfile "[i]Block Full Path[/i]")) (vla-InsertBlock ps (vlax-3d-point '(0.0 0.0 0.0)) ValidBlockName 1.0 1.0 1.0 0.0) (princ) ) (test) Edited June 3, 2016 by bababarghi Quote
Lee Mac Posted June 3, 2016 Posted June 3, 2016 Do you receive the error for all blocks, or for one block in particular? Quote
bababarghi Posted June 3, 2016 Author Posted June 3, 2016 Do you receive the error for all blocks, or for one block in particular? Hmmm. Good pick Lee. Actually it works fine with other blocks. I found out the problem is because of a nested block called _Oblique which has not been used anywhere in entire drawing and I can't even purge it. How can I modify my code to ignore the duplicate object? Or I need to load another lisp to get rid of that nested block first and then insert my desired block? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.