Results 1 to 5 of 5

Thread: TEST FOR HORIZONTAL OR VERTICAL LINE

  1. #1
    Member
    Join Date
    2018-08
    Posts
    7
    Login to Give a bone
    0

    Default TEST FOR HORIZONTAL OR VERTICAL LINE

    I am really struggling with this. I am trying to determine if a line is horizontal or vertical. I am simply checking to see what the angle of the line is by checking it angle property line.angle. In the following two screen shots you can see that the line in question has an angle of zero when I look at its properties but is returning a strange angle when I query it using vb.net. Am I missing something here?
    Attached Images Attached Images

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,544
    Login to Give a bone
    0

    Default Re: TEST FOR HORIZONTAL OR VERTICAL LINE

    What was wrong with the previous answer I gave you? How are you calculating the angle? Do you realize that AutoCAD api's use radians?
    C:> ED WORKING....

  3. #3
    Member
    Join Date
    2018-08
    Posts
    7
    Login to Give a bone
    0

    Default Re: TEST FOR HORIZONTAL OR VERTICAL LINE

    I am simply looking to see if the start x is equal to end x or start y is equal to end y and if start x is equal to end x the line should be horizontal. If start y is equal to end y the line should be vertical. But as you can see from the screen shots I sent this is not the case. The second screen shot was using the code you gave me.

  4. #4
    Member
    Join Date
    2009-04
    Posts
    6
    Login to Give a bone
    0

    Default Re: TEST FOR HORIZONTAL OR VERTICAL LINE

    Have you calculated how big the angle of 2.67346707152487E-15 (in RAD) is in degree? I did not calculate, but it is something like 0.00000000...xxx degree. Do you think it is not horizontal enough? The reason the angle is not exactly 0.0000 is probably because the 2 Y coordinates are not exactly 90.5177 (i.e. one is like 90.5177000002, the other could be 90.5177000003). To these Double type of numbers, you need to round them up to given precision to make them make sense. In your case, yes, the line is horizontal enough.

  5. #5
    Member
    Join Date
    2018-08
    Posts
    7
    Login to Give a bone
    0

    Default Re: TEST FOR HORIZONTAL OR VERTICAL LINE

    So your telling me that if I draw a line and constrain it to be horizontal it might still not be completely horizontal?

Similar Threads

  1. TEST FOR HORIZONTAL OR VERTICAL LINE
    By mike.lee771419 in forum ARX
    Replies: 3
    Last Post: 2019-05-24, 03:12 PM
  2. Replies: 6
    Last Post: 2005-10-21, 12:15 PM
  3. Vertical Line on Horizontal Lap Siding
    By Rhythmick in forum Revit - Rendering
    Replies: 9
    Last Post: 2005-03-15, 04:51 AM
  4. horizontal sweeps and vertical parameters
    By woethesinner in forum Revit Architecture - Families
    Replies: 0
    Last Post: 2004-09-27, 07:52 PM
  5. Mask difference on vertical plane vs. horizontal plane.
    By SkiSouth in forum Revit - Rendering
    Replies: 0
    Last Post: 2004-04-24, 01:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •