public double scanAngle(TBPLineSegment second, TBPoint interPoint) { Point3d p1, p2, p3; TBPLineSegment s1 = null; TBPLineSegment s2 = null; if ((interPoint == this.StartPoint) && (this.StartPoint == second.StartPoint)) { s1 = this.newReverse(); s2 = second; } else if ((interPoint == this.StartPoint) && (this.StartPoint == second.EndPoint)) { s1 = this.newReverse(); s2 = second.newReverse(); } else if ((interPoint == this.EndPoint) && (this.EndPoint == second.StartPoint)) { s1 = this; s2 = second; } else if ((interPoint == this.EndPoint) && (this.EndPoint == second.EndPoint)) { s1 = this; s2 = second.newReverse(); } p1 = s1.acPline.GetPointAtParameter(this.acPline.EndParam - 1); p2 = s1.EndPoint.acPoint; p3 = s2.acPline.GetPointAtParameter(1); return(AngleUtil.scanAngle(p1, p2, p3)); }
public double scanAngle() { Document acDoc = Application.DocumentManager.MdiActiveDocument; Database acCurDb = acDoc.Database; double r = 0; //using (Transaction trans = acCurDb.TransactionManager.StartTransaction()) //{ //Polyline3d pl = trans.GetObject(acPline.ObjectId, OpenMode.ForRead) as Polyline3d; for (int i = 0; i < acPline.EndParam - 1; i++) { r += AngleUtil.scanAngle(acPline.GetPointAtParameter(i), acPline.GetPointAtParameter(i + 1), acPline.GetPointAtParameter(i + 2)); } //} return(r); }