Line seleccion by angle

Discussion in 'AutoCAD' started by jgaston, Nov 22, 2004.

  1. jgaston

    jgaston Guest

    Who can I make a selection set of all the vertical lines of a single
    Layer?? I can't found the DXF code group for the angle value in a LINE
    entity

    Thanks in advance
     
    jgaston, Nov 22, 2004
    #1
  2. jgaston

    TomD Guest

    LINE objects do not have an angle property. You would have to compute the
    angle of each line by it's StartPoint and EndPoint.

    Dim vStPnt as Variant
    Dim vEndPnt as Variant
    If vStPnt(2) = vEndPnt(2) Then
    'Do whatever for the positive result
    End If

    ......depending, of course, on your definition of "vertical"
     
    TomD, Nov 22, 2004
    #2
  3. jgaston

    wivory Guest

    Hmmm...there seems to be some confusion here. Line objects DO have an Angle property. From the help:
    [pre]
    object.Angle

    object Line
    The object or objects this property applies to.

    Angle Double; read-only
    The angle of the line in degrees. The angle measurement begins at the X axis and proceeds in a counterclockwise direction.
    [/pre]
    As can be seen from the defintion however, the angle is relative to the X axis so won't help with identifying vertical lines. I think you're on the right track Tom with looking at the Z component of the Start and End points, but for a vertical line the Z's would be *different* and the X's and Y's would be the same.

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Nov 23, 2004
    #3
  4. Lots of confusion, apparently, since I read Tom's comment about "depends on
    what you mean by vertical" as saying he needed to use a fuzzy equal to catch
    almost-vertical lines. The one below is courtesy of www.acadx.com, slightly
    modified.

    Code:
    Function fuzzEq(val1 As Variant, val2 As Variant, Optional pFuzz As Double =
    0.001) As Boolean
    fuzzEq = (Abs(val1 - val2) < pFuzz)
    End Function
    
    James

    Angle property.
     
    James Belshan, Nov 23, 2004
    #4
  5. Are you talking about 2d lines (where z=0) ??
    if so, then you could try to filter for lines
    which have startpoint X = to ending point X
     
    Jorge Jimenez, Nov 23, 2004
    #5
  6. jgaston

    jgaston Guest

    Really, I'm try to select in a single step, without interact inside the
    selection set.

    I'm going to try the Jorge's idea

    Thanks to everybody.
     
    jgaston, Nov 23, 2004
    #6
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.