filtering SS for entities in layout

Discussion in 'AutoCAD' started by bbtools, Jan 4, 2005.

  1. bbtools

    bbtools Guest

    The code below comes back with a Count of 0, even though there are entities on the current Layout.

    What am I doing wrong?

    Sub main()
    Dim al As AcadLayout
    Dim ss As AcadSelectionSet
    Dim gpCode(1) As Integer
    Dim dataValue(1) As Variant
    Dim groupCode As Variant
    Dim dataCode As Variant

    Set al = ThisDrawing.ActiveLayout
    On Error Resume Next
    Set ss = ThisDrawing.SelectionSets.Item("ss")
    If Err > 0 Then Set ss = ThisDrawing.SelectionSets.Add("ss")
    On Error GoTo 0
    ss.Clear

    gpCode(0) = 67
    dataValue(0) = IIf(al.Name = "Model", 0, 1)
    gpCode(1) = 410
    dataValue(1) = al.Name

    groupCode = gpCode
    dataCode = dataValue

    ss.Select acSelectionSetAll, , , groupCode, dataCode
    MsgBox al.Name & " " & ss.Count
    End Sub
     
    bbtools, Jan 4, 2005
    #1
  2. bbtools

    MP Guest

    If I'm not mistaken there's a known bug that prevents selection filter on
    tab name with 410 code.
    You might check google for workarounds.

    hth
    Mark

    entities on the current Layout.
     
    MP, Jan 4, 2005
    #2
  3. bbtools

    Jeff Mishler Guest

    If you want all of the objects in a layout, just grab the Layout's
    block........
     
    Jeff Mishler, Jan 5, 2005
    #3
  4. bbtools

    FXCASTIL Guest

    I had the same problem there is a bug in the layout filter code
    I had to use lisp to filter the entities on a layout name
     
    FXCASTIL, Mar 1, 2005
    #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.