• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD Civil 3D

    Reply
    Active Member
    RyanElam
    Posts: 8
    Registered: ‎07-12-2010

    Re: Can not purge blocks

    11-14-2012 12:01 PM in reply to: jrauch

    We recieved some files from an architect and they contained a bunch of stuff that has been since embeded into our base files.  It's making our drawings incredibly slow and frustrating the entire team.  We are way too far along to try and re-build new line work.  Copying our likework out and wblocking have all resulted in these entities being carried through.

    Ryan

    Civil 3D 2013
    Please use plain text.
    *Expert Elite*
    Posts: 3,032
    Registered: ‎07-22-2003

    Re: Can not purge blocks

    11-14-2012 12:09 PM in reply to: RyanElam

    And here's another, safer, variation that will only remove the blocks created by Group:

    (vlax-for blk (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
      (if (wcmatch (vla-get-name blk) "`*A*")
        (vla-delete blk)
        )
      )

     Or another that does the Group blocks and Anonymous blocks:

     

    (vlax-for blk (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
      (if (wcmatch (vla-get-name blk) "`*A*,`*U*")
        (vla-delete blk)
        )
      )

     

    Jeff_M, also a frequent Swamper
    Please use plain text.
    *Expert Elite*
    Posts: 1,525
    Registered: ‎05-21-2008

    Re: Can not purge blocks

    11-14-2012 12:14 PM in reply to: Jeff_M

    Here's one that explodes anonymous blocks, something that was driving me nutty:

     

    (defun c:test (/ ss old-echo item ss1 item1)
      (setq old-echo (getvar "CMDECHO"))
      (setvar "CMDECHO" 0)
      (if (setq ss (ssget '((2 . "`*U*"))))
        (foreach item (mapcar 'cadr (ssnamex ss))
          (command "Explode" item)
          (while
    	(setq ss1 (ssget "_P" '((2 . "`*U*"))))
    	 (foreach item1	(mapcar 'cadr (ssnamex ss1))
    	   (command "Explode" item1)
    	 )
          )
        )
      )
      (setq ss nil)
      (setq ss1 nil)
      (setvar "CMDECHO" old-echo)
      (princ)
    )

     Don't know if that is related or not.

    __________________________________________________________
    Win 7 Pro, 32 bit; Intel Core i5 @ 2.80GHz; 4GB RAM—Civil 3D 2008 & 2011
    __________________________________________________________
    Credit where credit is due! Give kudos or accept as solution whenever you can.
    Please use plain text.
    Active Member
    RyanElam
    Posts: 8
    Registered: ‎07-12-2010

    Re: Can not purge blocks

    11-14-2012 04:03 PM in reply to: troma

    I ended up exporting the linework base file I had to a DXF file and then brought it back in.  This allowed me to then purge all of the blocks I was unable to see or purge before.  I'm not sure if that's the best way to do it, but nothing else was working.  Luckily I didn't have to do something like that to a file that had any built in intelligence, it was just lines.  Thanks for everyone's help.

    Ryan

    Civil 3D 2013
    Please use plain text.