purge objects from a block?

Discussion in 'AutoCAD' started by C Witt, Aug 1, 2003.

  1. C Witt

    C Witt Guest

    ok.. How can you "purge" nested items from a block?.. (without exploding
    it)..

    What could I want to purge?.. errant dimension styles, that's what.
    why? becuase they are not being used anymore and clutter our drawings.

    Why not just re-do the blocks?.. there are WAY too many.

    Hope someone has an idea..
     
    C Witt, Aug 1, 2003
    #1
  2. C Witt

    Jamie Duncan Guest

    I think redoing the blocks is far easier than you think:

    (defun c:fixents (/ ss1 temp ent1 looper entdat bnm ctr enttyp bl_list)
    (command ".layer" "t" "0" "un" "0" "s" "0" "")
    (setq ss1 (ssadd) looper T ctr 0)
    (setq ss1 (ssget "x"))
    (repeat (sslength ss1)
    (setq ent1 (ssname ss1 ctr) entdat (entget ent1) enttyp (cdr (assoc 0
    entdat)))
    (if (= enttyp "INSERT")
    (progn
    (setq bl_list (list (cdr (assoc 2 entdat))))
    (foreach bnm bl_list
    (jddfixablock bnm)
    )
    )
    )
    (setq ctr (+ ctr 1))
    )
    )
    (defun jddfixablock (bname / enam1)
    (setq enam1 (tblobjname "block" bname))
    ;;;write a block entmake here with bname
    (entmake (tblsearch bname));;; restart block def'n
    (while (setq enam1 (entnext enam1))
    ;;; in here you just need to write a series of if statements testing for
    whatever objects might offend you
    if they offend, ignore them, if they don't offend, entmake them
    ie
    (entmake enam1)
    (if (= (cdr (assoc 0 (entget enam1))) "INSERT")(setq bl_list (append
    bl_list (list (cdr (assoc 2 (entget ent1)))))))
    )
    ;;;close out block def'n
    (entmake '((0 . "ENDBLK")))
    )

    this will need some work & testing, but it's a start


    Jamie
     
    Jamie Duncan, Aug 1, 2003
    #2
  3. C Witt

    John Uhden Guest

    With ActiveX you can just (vla-delete) unwanted objects.
     
    John Uhden, Aug 2, 2003
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.