Jump to content

Recommended Posts

Posted

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)

Posted

Maybe why (setq blk ? The insert works without the setq

Posted (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 by bababarghi
Posted

Do you receive the error for all blocks, or for one block in particular?

Posted
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?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...