AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
Contributor
RyanElam
Posts: 13
Registered: ‎07-12-2010
Message 11 of 14 (571 Views)

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
*Expert Elite*
Jeff_M
Posts: 4,293
Registered: ‎07-22-2003
Message 12 of 14 (567 Views)

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
*Expert Elite*
troma
Posts: 2,520
Registered: ‎05-21-2008
Message 13 of 14 (564 Views)

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.


Credit where credit is due! Give kudos or accept as solution whenever you can.

Contributor
RyanElam
Posts: 13
Registered: ‎07-12-2010
Message 14 of 14 (553 Views)

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
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.