private void method_0(ObjectId[] objectId_0) { Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; Global.SuspendEpsilon(0.0, 0.0); try { List <Edge> unorderedEdges = Conversions.ToCeometricCADDataEdgeList(objectId_0); int num = 0; int num2 = 0; int num3 = 0; bool eliminateZeroLengthSegments = true; if (PLine.string_1.Trim().ToUpper() == "N") { eliminateZeroLengthSegments = false; } PLine.ConstructFromUnorderedSegments(unorderedEdges, PLine.int_0, ref num2, ref num, ref num3, true, true, eliminateZeroLengthSegments); if (PLine.string_0 == "Y") { DBManager.EraseObjects(objectId_0, 100000); } editor.WriteMessage("\nNumber of segments added : " + num.ToString()); editor.WriteMessage("\nNumber of zero-length segments: " + num3.ToString()); editor.WriteMessage("\nNumber of polylines generated : " + num2.ToString()); Global.ResumeEpsilon(); } catch (System.Exception ex) { Global.ResumeEpsilon(); editor.WriteMessage("\n" + ex.Message); } }
private List <Edge> genAssistContour(List <Triangle> list, Plane plane, CoordinateSystem userSystem, ObjectId layerId, double assistElevation, int relevantDecimals, int num3) { Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; int num5 = 0; int num4 = 0; Plane assistPlane = plane.DeepCopy(); assistPlane.Point.Z += assistElevation; List <Edge> unorderedEdges = this.getInterSection2(list, assistPlane, num3, ref num5, ref num4); if (unorderedEdges == null || unorderedEdges.Count <= 0) { return(null); } Autodesk.AutoCAD.Geometry.Plane plane1 = new Autodesk.AutoCAD.Geometry.Plane(new Autodesk.AutoCAD.Geometry.Point3d(0, 0, 0), new Autodesk.AutoCAD.Geometry.Vector3d(0, 0, 1)); Autodesk.AutoCAD.Geometry.Matrix3d prjMat1 = Autodesk.AutoCAD.Geometry.Matrix3d.Projection(plane1, plane1.Normal); TransformUtil.Transform(unorderedEdges, prjMat1); List <PLine> pllist = null; //pllist = DBManager.WritePlinesInDataBase2(unorderedEdges, userSystem, relevantDecimals, false, layerId, Color.White); int num = 0; int num2 = 0; int num33 = 0; Global.SuspendEpsilon(0.0, 0.0); try { if (userSystem != null) { Conversions.ToWCS(userSystem, unorderedEdges); } //WritePlinesInDataBase2和ConstructFromUnorderedSegments只能调用一个 if (pllist == null) { pllist = PLine.ConstructFromUnorderedSegments(unorderedEdges, relevantDecimals, ref num2, ref num, ref num33, false, false, false); } cmd.mydb.assistContourDics[cmd.mydb.Resolution].set(assistElevation + ContourLineComputation.spacing / 2, pllist); if (unorderedEdges.Count == 0) { editor.WriteMessage("\nNo contours at elevation : " + assistElevation.ToString()); } } catch (System.Exception ex) { editor.WriteMessage("genAssistContour error." + ex.Message); } Global.ResumeEpsilon(); return(unorderedEdges); }