Modifying block contents

Discussion in 'AutoCAD' started by Peter Jamtgaard, Dec 16, 2003.

  1. Forgive me if I am double posting but I am having trouble getting my posts
    to appear on the newsgroup.

    This is a repost of a earlier response.

    "TCEBobThis routine will change all of the entities in a block to be on
    layer "0"
    and linetype continuous, and color 256

    Peter Jamtgaard

    (defun C:BLAY ()
    (if (setq ESEL (entsel "\nSelect Block: "))
    (progn
    (setq EOBJ (vlax-ename->vla-object (car ESEL)))
    (if (wcmatch (vla-get-objectname EOBJ)
    "AcDbBlockReference,AcDbMInsertBlock"
    )
    (vlax-for OBJ
    (vla-item (vla-get-blocks
    (vla-get-activedocument
    (vlax-get-acad-object)
    )
    )
    (vla-get-name EOBJ)
    )
    (vla-put-layer OBJ "0")
    (vla-put-linetype OBJ "continuous")
    (vla-put-color OBJ 256)
    )
    )
    )
    )
    (vl-cmdf "regen")
    )
     
    Peter Jamtgaard, Dec 16, 2003
    #1
  2. Peter Jamtgaard

    TCEBob Guest

    Peter, thanks for your effort! I'll give your code a try later.

    rs
     
    TCEBob, Dec 16, 2003
    #2
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.