Ejemplo n.º 1
0
        public void SliceLineCommand()
        {
            Editor   editor   = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
            Database arg_15_0 = HostApplicationServices.WorkingDatabase;

            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] objectId_ = CommandLineQuerries.SelectLines(false);
                ngeometry.VectorGeometry.Plane planeNormalized = CommandLineQuerries.Specify3PSystem().GetPlaneNormalized();
                int num = 0;
                while (num == 0)
                {
                    Point             left = new Point();
                    PromptPointResult promptPointResult = CommandLineQuerries.SpecifyPointOrKeepBothSides();
                    if (promptPointResult.Status == (PromptStatus)(-5005))
                    {
                        num = 0;
IL_F2_:
                        this.method_0(objectId_, planeNormalized, num);
                        return;
                    }
                    if (promptPointResult.Status == (PromptStatus)5100)
                    {
                        Point3d value = promptPointResult.Value;
                        left = new Point(value.X, value.Y, value.Z);
                        num  = Math.Sign(ngeometry.VectorGeometry.Vector3d.Dot(planeNormalized.NormalVector, new ngeometry.VectorGeometry.Vector3d(left - planeNormalized.Point)));
                        if (num == 0)
                        {
                            editor.WriteMessage("\nInvalid point: point is on plane.");
                        }
                    }
                    else if (promptPointResult.Status == (PromptStatus)(-5002))
                    {
                        CommandLineQuerries.OnCancelled();
                    }
                    else if (promptPointResult.Status != (PromptStatus)5100)
                    {
                        CommandLineQuerries.OnNotOK();
                    }
                }
                goto IL_F2;
IL_F2:
                {
                    this.method_0(objectId_, planeNormalized, num);
                    return;
                }
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage(Environment.NewLine + ex.Message + Environment.NewLine);
            }
        }
Ejemplo n.º 2
0
        public void LinesToPolylines()
        {
            Editor   editor   = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
            Database arg_15_0 = HostApplicationServices.WorkingDatabase;

            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] objectId_ = CommandLineQuerries.SelectLines(false);
                PLine.int_0    = CommandLineQuerries.SpecifyInteger("Specify number of relevant decimal digits", PLine.int_0, 0, 12, false, true);
                PLine.string_1 = CommandLineQuerries.KeywordYesNo("Eliminate zero length segments", PLine.string_1, false, false);
                PLine.string_0 = CommandLineQuerries.KeywordYesNo("Delete original lines", PLine.string_0, false, false);
                this.method_0(objectId_);
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage("\n" + ex.Message);
            }
        }
Ejemplo n.º 3
0
        public void DevelopmentCommand()
        {
            Database arg_05_0 = HostApplicationServices.WorkingDatabase;
            Editor   editor   = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] objectId_ = CommandLineQuerries.SelectLines(false);
                CMD_ReconstructSurface.string_0 = CommandLineQuerries.InsertOnLayer_Current_Line(CMD_ReconstructSurface.string_0);
                CMD_ReconstructSurface.string_1 = CommandLineQuerries.SpecifyOutputType(CMD_ReconstructSurface.string_1);
                CMD_ReconstructSurface.int_0    = CommandLineQuerries.SpecifyInteger("Specify number of relevant decimal digits", CMD_ReconstructSurface.int_0, 0, 12, false, true);
                this.Reconstruct(objectId_);
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage(Environment.NewLine + ex.Message + Environment.NewLine);
            }
        }
Ejemplo n.º 4
0
        public void ProjectLinesCommand()
        {
            Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] objectId_  = CommandLineQuerries.SelectFaces(false);
                ObjectId[] objectId_2 = CommandLineQuerries.SelectLines(false);
                LineProjection.string_2 = CommandLineQuerries.SpecifyProjectionDirection(LineProjection.string_2);
                //new Vector3d(0.0, 0.0, 1.0);
                ngeometry.VectorGeometry.Vector3d directionVector  = new ngeometry.VectorGeometry.Vector3d(1.0, 0.0, 0.0);
                ngeometry.VectorGeometry.Vector3d directionVector2 = new ngeometry.VectorGeometry.Vector3d(0.0, 1.0, 0.0);
                string a;
                if ((a = LineProjection.string_2.ToUpper()) != null)
                {
                    if (!(a == "X"))
                    {
                        if (!(a == "Y"))
                        {
                            if (!(a == "Z"))
                            {
                                if (!(a == "U"))
                                {
                                    if (!(a == "2P"))
                                    {
                                        goto IL_267;
                                    }
                                    CommandLineQuerries.Specify2PDirection().BasisVector[2].Normalize();
                                }
                                else
                                {
                                    Conversions.GetUCS().BasisVector[2].Normalize();
                                }
                            }
                            else
                            {
                                directionVector  = new ngeometry.VectorGeometry.Vector3d(1.0, 0.0, 0.0);
                                directionVector2 = new ngeometry.VectorGeometry.Vector3d(0.0, 1.0, 0.0);
                                //new Vector3d(0.0, 0.0, 1.0);
                            }
                        }
                        else
                        {
                            directionVector  = new ngeometry.VectorGeometry.Vector3d(1.0, 0.0, 0.0);
                            directionVector2 = new ngeometry.VectorGeometry.Vector3d(0.0, 0.0, 1.0);
                            //new Vector3d(0.0, 1.0, 0.0);
                        }
                    }
                    else
                    {
                        directionVector  = new ngeometry.VectorGeometry.Vector3d(0.0, 1.0, 0.0);
                        directionVector2 = new ngeometry.VectorGeometry.Vector3d(0.0, 0.0, 1.0);
                        //new Vector3d(0.0, 0.0, 1.0);
                    }
                    ngeometry.VectorGeometry.Point point = new ngeometry.VectorGeometry.Point(0.0, 0.0, 0.0);
                    ngeometry.VectorGeometry.Plane plane = new ngeometry.VectorGeometry.Plane(point, directionVector, directionVector2);
                    CoordinateSystem coordinateSystem_   = new CoordinateSystem(plane);
                    LineProjection.string_1 = CommandLineQuerries.InsertOnLayer_Current_Face_Line(LineProjection.string_1);
                    LineProjection.string_0 = CommandLineQuerries.KeywordYesNo("Delete original lines", LineProjection.string_0, false, false);
                    this.method_0(objectId_2, objectId_, coordinateSystem_, true);
                    return;
                }
IL_267:
                throw new System.Exception("Invalid option keyword.");
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage("\n" + ex.Message + "\n");
            }
        }