Ejemplo n.º 1
0
        public void Hull3dCommand()
        {
            Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] idArray = CommandLineQuerries.SelectPoints(false);
                this.ComputePrincipalAxisBoundingBox(idArray);
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage("\n" + ex.Message);
            }
        }
Ejemplo n.º 2
0
        public void BlurPointsCommand()
        {
            Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] objectId_ = CommandLineQuerries.SelectPoints(false);
                double     num       = CommandLineQuerries.SpecifyDouble("Specify blur radius", PointBlurring.double_0, false, false, false, false);
                if (num != -1.0)
                {
                    PointBlurring.double_0 = num;
                    this.method_0(objectId_);
                }
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage("\n" + ex.Message);
            }
        }
Ejemplo n.º 3
0
        public void EliminatePoints2dCommand()
        {
            Editor   editor   = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
            Database arg_15_0 = HostApplicationServices.WorkingDatabase;

            new List <IdPoint>();
            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] pointIDs = CommandLineQuerries.SelectPoints(false);
                PointElimination.double_0 = CommandLineQuerries.SpecifyDouble("Specify snap radius", PointElimination.double_0, false, false, false, true);
                PointElimination.string_0 = CommandLineQuerries.KeepIfMultiple(PointElimination.string_0);
                int num = 0;
                IdPoint.EraseDublicates2d(pointIDs, PointElimination.double_0, PointElimination.string_0, ref num);
                editor.WriteMessage("\nNumber of points erased: " + num);
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage("\n" + ex.Message);
            }
        }
Ejemplo n.º 4
0
        public void XYZOUT()
        {
            Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            ObjectId[] array = null;
            try
            {
                ////LicenseManager.CheckValid("FULL");
                IO2.string_6 = CommandLineQuerries.SpecifyEntitiesBySelectionOrByLayer(IO2.string_6);
                if (IO2.string_6 == "S")
                {
                    array = CommandLineQuerries.SelectPoints(true);
                }
                else if (IO2.string_6 == "L")
                {
                    IO2.string_7 = CommandLineQuerries.SpecifyLayerName(IO2.string_7);
                    if (!DBManager.ExistsLayer(IO2.string_7))
                    {
                        throw new ArgumentException("Layer does not exist.");
                    }
                    array = DBManager.GetPointsOnLayer(IO2.string_7);
                    if (array == null)
                    {
                        throw new ArgumentException("No points selected.");
                    }
                    editor.WriteMessage(Environment.NewLine + array.Length + " points selected.");
                }
                CommandLineQuerries.SpecifyFileNameForWrite(ref IO2.string_5, ref IO2.string_8, "xyz");
                IO2.string_9 = CommandLineQuerries.SpecifyDelimiter(IO2.string_9);
                IO2.int_0    = CommandLineQuerries.SpecifyColumnWidth(IO2.int_0);
                IO2.int_1    = CommandLineQuerries.SpecifyDecimalDigits(IO2.int_1);
                this.WriteXYZ(array);
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage(Environment.NewLine + ex.Message + Environment.NewLine);
            }
        }
Ejemplo n.º 5
0
        public void ProjectPointsCommand()
        {
            Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] objectId_ = CommandLineQuerries.SelectFaces(true);
                PointProjection.string_0 = CommandLineQuerries.SpecifyRasterBySelectionOrByLayer(PointProjection.string_0);
                ObjectId[] array = null;
                if (PointProjection.string_0 == "S")
                {
                    array = CommandLineQuerries.SelectPoints(true);
                }
                else if (PointProjection.string_0 == "L")
                {
                    PointProjection.string_1 = CommandLineQuerries.SpecifyLayerName(PointProjection.string_1);
                    if (!DBManager.ExistsLayer(PointProjection.string_1))
                    {
                        throw new ArgumentException("Layer does not exist.");
                    }
                    array = DBManager.GetPointsOnLayer(PointProjection.string_1);
                    if (array == null)
                    {
                        throw new ArgumentException("No points selected.");
                    }
                    editor.WriteMessage(Environment.NewLine + array.Length + " points selected.");
                }
                PointProjection.string_4 = CommandLineQuerries.SpecifyProjectionDirection(PointProjection.string_4);
                ngeometry.VectorGeometry.Vector3d normalVector = new ngeometry.VectorGeometry.Vector3d(0.0, 0.0, 1.0);
                string a;
                if ((a = PointProjection.string_4.ToUpper()) != null)
                {
                    if (!(a == "X"))
                    {
                        if (!(a == "Y"))
                        {
                            if (!(a == "Z"))
                            {
                                if (!(a == "U"))
                                {
                                    if (!(a == "2P"))
                                    {
                                        goto IL_1E6;
                                    }
                                    normalVector = CommandLineQuerries.Specify2PDirection().BasisVector[2].Normalize();
                                }
                                else
                                {
                                    normalVector = Conversions.GetUCS().BasisVector[2].Normalize();
                                }
                            }
                            else
                            {
                                normalVector = new ngeometry.VectorGeometry.Vector3d(0.0, 0.0, 1.0);
                            }
                        }
                        else
                        {
                            normalVector = new ngeometry.VectorGeometry.Vector3d(0.0, 1.0, 0.0);
                        }
                    }
                    else
                    {
                        normalVector = new ngeometry.VectorGeometry.Vector3d(1.0, 0.0, 0.0);
                    }
                    Point point = new Point(0.0, 0.0, 0.0);
                    ngeometry.VectorGeometry.Plane plane = new ngeometry.VectorGeometry.Plane(point, normalVector);
                    CoordinateSystem coordinateSystem_   = new CoordinateSystem(plane);
                    PointProjection.string_3 = CommandLineQuerries.InsertOnLayer_Current_Face_Point(PointProjection.string_3);
                    PointProjection.string_2 = CommandLineQuerries.KeywordYesNo("Delete original points", PointProjection.string_2, false, false);
                    PointProjection.string_5 = CommandLineQuerries.KeepIfMultiple(PointProjection.string_5);
                    this.method_0(array, objectId_, coordinateSystem_);
                    return;
                }
IL_1E6:
                throw new System.Exception("Invalid option keyword.");
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage("\n" + ex.Message + "\n");
            }
        }
Ejemplo n.º 6
0
    public void method_0()
    {
        Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

        try
        {
            //TCPlugin.LicenseManager.CheckValid("FULL");
            ObjectId[] objectId_ = CommandLineQuerries.SelectPoints(false);
            Class1.string_0 = CommandLineQuerries.SpecifyProjectionDirection(Class1.string_0);
            ngeometry.VectorGeometry.Vector3d vector3d = new ngeometry.VectorGeometry.Vector3d(0.0, 0.0, 1.0);
            string a;
            if ((a = Class1.string_0.ToUpper()) != null)
            {
                if (!(a == "X"))
                {
                    if (!(a == "Y"))
                    {
                        if (!(a == "Z"))
                        {
                            if (!(a == "U"))
                            {
                                if (!(a == "2P"))
                                {
                                    goto IL_150;
                                }
                                vector3d = CommandLineQuerries.Specify2PDirection().BasisVector[2];
                                vector3d = vector3d.Normalize();
                            }
                            else
                            {
                                vector3d = Conversions.GetUCS().BasisVector[2].Normalize();
                            }
                        }
                        else
                        {
                            vector3d = new ngeometry.VectorGeometry.Vector3d(0.0, 0.0, 1.0);
                        }
                    }
                    else
                    {
                        vector3d = new ngeometry.VectorGeometry.Vector3d(0.0, 1.0, 0.0);
                    }
                }
                else
                {
                    vector3d = new ngeometry.VectorGeometry.Vector3d(1.0, 0.0, 0.0);
                }
                Point point = new Point(0.0, 0.0, 0.0);
                ngeometry.VectorGeometry.Plane plane = new ngeometry.VectorGeometry.Plane(point, vector3d);
                CoordinateSystem coordinateSystem_   = new CoordinateSystem(plane);
                Class1.smethod_0(objectId_, coordinateSystem_);
                return;
            }
IL_150:
            throw new System.Exception("Invalid option keyword.");
        }
        catch (System.Exception ex)
        {
            editor.WriteMessage("\n" + ex.Message);
        }
    }
        public void MinAreaEnclosingRectnagleCommand()
        {
            Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] idArray = CommandLineQuerries.SelectPoints(false);
                CMD_MinAreaEnclosingRectangle.string_0 = CommandLineQuerries.SpecifyProjectionDirection(CMD_MinAreaEnclosingRectangle.string_0);
                ngeometry.VectorGeometry.Vector3d vector3d = new ngeometry.VectorGeometry.Vector3d(0.0, 0.0, 1.0);
                string a;
                if ((a = CMD_MinAreaEnclosingRectangle.string_0.ToUpper()) != null)
                {
                    if (!(a == "X"))
                    {
                        if (!(a == "Y"))
                        {
                            if (!(a == "Z"))
                            {
                                if (!(a == "U"))
                                {
                                    if (!(a == "2P"))
                                    {
                                        goto IL_150;
                                    }
                                    vector3d = CommandLineQuerries.Specify2PDirection().BasisVector[2];
                                    vector3d = vector3d.Normalize();
                                }
                                else
                                {
                                    vector3d = Conversions.GetUCS().BasisVector[2].Normalize();
                                }
                            }
                            else
                            {
                                vector3d = new ngeometry.VectorGeometry.Vector3d(0.0, 0.0, 1.0);
                            }
                        }
                        else
                        {
                            vector3d = new ngeometry.VectorGeometry.Vector3d(0.0, 1.0, 0.0);
                        }
                    }
                    else
                    {
                        vector3d = new ngeometry.VectorGeometry.Vector3d(1.0, 0.0, 0.0);
                    }
                    Point point = new Point(0.0, 0.0, 0.0);
                    ngeometry.VectorGeometry.Plane plane = new ngeometry.VectorGeometry.Plane(point, vector3d);
                    CoordinateSystem actualCS            = new CoordinateSystem(plane);
                    CMD_MinAreaEnclosingRectangle.ComputeMinAreaEnclosingRectangle(idArray, actualCS);
                    return;
                }
IL_150:
                throw new System.Exception("Invalid option keyword.");
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage("\n" + ex.Message);
            }
        }