filter out spesific block from spesific layout in VBA

Discussion in 'AutoCAD' started by Knut Selvik, Jun 9, 2004.

  1. Knut Selvik

    Knut Selvik Guest

    I have tried to filter out a block vith name "SHEET_A0" from layout
    "Layout1" with selection set filters.

    grpcode(0) = 0
    dataval(0) = "INSERT"
    grpcode(1) = 2
    dataval(1) = "SHEET_A0"
    grpcode(2) = 410
    dataval(2) = "Layout1"

    result i 0 entities.

    Why ???
     
    Knut Selvik, Jun 9, 2004
    #1
  2. Knut Selvik

    Jürg Menzi Guest

    Hi Knut

    There is no 410 group to filter...
    You can do something like this (thanks Tony T.):

    Dim idBlock As Long
    idBlock = ThisDrawing.Layouts("Layout1").Block.ObjectId

    For i = 0 to sset.Count - 1
    If sset(i).OwnerId = idBlock Then
    retval.Add(sset(i))
    End If
    Next i

    Cheers
     
    Jürg Menzi, Jun 9, 2004
    #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.