Jump to content

Remove all 3DSolids within Blocks Script


Recommended Posts

Hi

 

Does anybody know of a script for AutoCAD 2012 that will remove all 3DSolids within a drawing even if they are nested within a block/s?

 

Any help would be great

 

Thanks

 

Bob

Link to comment
Share on other sites

  • 4 weeks later...

This can't be done with a script (*.scr). But a Lisp solution is possible:

(defun c:Test ( / doc)
 (setq doc (vla-get-activedocument (vlax-get-acad-object)))
 (vla-endundomark doc)
 (vla-startundomark doc)
 (vlax-for blk (vla-get-blocks doc)
   (vlax-for obj blk
     (if (= "AcDb3dSolid" (vla-get-objectname obj))
       (vla-delete obj)
     )
   )
 )
 (vla-endundomark doc)
 (princ)
)

Link to comment
Share on other sites

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...