Selection set and blocks

Discussion in 'AutoCAD' started by A-Design, Nov 15, 2004.

  1. A-Design

    A-Design Guest

    Hi,

    I have written a selection set base on :
    FilterType(0) = 2
    FilterData(0) = "*"
    to select all the blocks in the drawing and is which fine,now I need a
    procedure to find all the layers of each block's components and put all
    entities on these layers in one single layer ( all blocks and their
    components in one Layer, not just the blocks).

    Can anyone help me with this please ?
    Thanks,
    Afshin
     
    A-Design, Nov 15, 2004
    #1
  2. Sounds like you are taking the wrong approach. If you need to modify all the
    blocks in the drawing why bother with a selection set? Just iterate thru the
    Blocks collection (skipping MS and layouts).

    --
    R. Robert Bell


    Hi,

    I have written a selection set base on :
    FilterType(0) = 2
    FilterData(0) = "*"
    to select all the blocks in the drawing and is which fine,now I need a
    procedure to find all the layers of each block's components and put all
    entities on these layers in one single layer ( all blocks and their
    components in one Layer, not just the blocks).

    Can anyone help me with this please ?
    Thanks,
    Afshin
     
    R. Robert Bell, Nov 15, 2004
    #2
  3. A-Design

    MP Guest

    your filtered selection set will take care of the block insertions
    (though as Robert says, since you're getting all block definitions - the
    filtered set won't save much - though you still need the blk refs for
    attributes - see below)

    to do the components of the block(with the exception of attributes), use the
    block definitions(not the references)

    dim oEnt as acadEntity

    for each oEnt in oBlkDef
    oEnt.Layer = sTargetLayer
    Next oEnt

    for attributes, you'd get the list of attribs from the blockref and step
    through those
    if BlkRef.HasAttributes
    then
    vatts = BlkRef.GetAttributes
    For i = 0 to Ubound(vatts)
    vatts(i).Layer = sTargetLayer
    Next i
    end if
     
    MP, Nov 15, 2004
    #3
  4. A-Design

    A-Design Guest

    Thank you (Robert & MP),



     
    A-Design, Nov 15, 2004
    #4
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.