Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created October 7, 2020 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/5ae0772fa4054fc48470758d1197d10a to your computer and use it in GitHub Desktop.
Save chuongmep/5ae0772fa4054fc48470758d1197d10a to your computer and use it in GitHub Desktop.
public static bool IsHorizontal(this Line Line)
{
double TOLERANCE = 0.0000001;
XYZ p1 = Line.GetEndPoint(0);
XYZ p2 = Line.GetEndPoint(1);
return Math.Abs(p1.Y - p2.Y) < TOLERANCE;
}
public static bool IsVertical(this Line Line)
{
double TOLERANCE = 0.0000001;
XYZ p1 = Line.GetEndPoint(0);
XYZ p2 = Line.GetEndPoint(1);
return Math.Abs(p1.X - p2.X) < TOLERANCE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment