Selecting 3D polylines using VBA 6

Discussion in 'AutoCAD' started by ajtruckle, Nov 9, 2004.

  1. ajtruckle

    ajtruckle Guest

    I am trying to use SelectFromScreen to select just 3D polylines.

    ' Create a new selection set to hold the 3D POLYLINE entities
    Set ssPoly = ThisDrawing.SelectionSets.Add("SH_POLY_SSET")

    ' Build a filter array
    ' Type of entity to select
    FilterType(0) = 0
    FilterData(0) = "Polyline"
    ' Layer of entity
    FilterType(1) = 8
    FilterData(1) = lstLayers.Value

    ' This will select ALL polylines


    ' Get user to select entities
    Call ssPoly.SelectOnScreen(FilterType, FilterData)

    But this will select 2D and 3D polylines. I could iterate the polylines and examine the .Type against 3D but I just want to directly select simple 3D polylines.

    How do I do it?
     
    ajtruckle, Nov 9, 2004
    #1
  2. ajtruckle

    ajtruckle Guest

    I have resolved it:

    ' Build a filter array
    ' Type of entity to select
    FilterTypePoly(0) = 0
    FilterDataPoly(0) = "Polyline"
    ' Layer of entity
    FilterTypePoly(1) = 8
    FilterDataPoly(1) = lstLayers.Value
    ' Bitwise AND
    FilterTypePoly(2) = -4
    FilterDataPoly(2) = "&="
    ' 3D Polyline
    FilterTypePoly(3) = 70
    FilterDataPoly(3) = 8

    I would like to know if this value 8 is defined as a constant though...
     
    ajtruckle, Nov 9, 2004
    #2
  3. ajtruckle

    Jürg Menzi Guest

    Hi ajtruckle
    Yes... from help:

    Polyline flag (bit-coded); default is 0:
    1 = This is a closed polyline (or a polygon mesh closed in the M direction)
    2 = Curve-fit vertices have been added
    4 = Spline-fit vertices have been added
    8 = This is a 3D polyline
    16 = This is a 3D polygon mesh
    32 = The polygon mesh is closed in the N direction
    64 = The polyline is a polyface mesh
    128 = The linetype pattern is generated continuously around the vertices of this
    polyline

    Cheers
     
    Jürg Menzi, Nov 9, 2004
    #3
  4. ajtruckle

    ajtruckle Guest

    What I meant was, was "8" assigned a constant in VBA...

    Thanks anyway.
     
    ajtruckle, Nov 9, 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.