Exemplo n.º 1
0
        public void GenerateSolidCommand()
        {
            ProgressMeter progressMeter = new ProgressMeter();
            Database      arg_0B_0      = HostApplicationServices.WorkingDatabase;
            Editor        editor        = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            this.messageFilter_0 = new MessageFilter();
            System.Windows.Forms.Application.AddMessageFilter(this.messageFilter_0);
            try
            {
                //LicenseManager.CheckValid("FULL");
                ObjectId[] objectId_ = CommandLineQuerries.SelectFaces(false);
                CMD_FacesToSolid.string_1 = CommandLineQuerries.SpecifyReferencePlane(CMD_FacesToSolid.string_1);
                CoordinateSystem coordinateSystem = CoordinateSystem.Global();
                if (CMD_FacesToSolid.string_1 == "U")
                {
                    coordinateSystem = Conversions.GetUCS();
                }
                if (CMD_FacesToSolid.string_1 == "3P")
                {
                    coordinateSystem = CommandLineQuerries.Specify3PSystem();
                }
                coordinateSystem.Orthonormalize();
                CMD_FacesToSolid.double_0 = CommandLineQuerries.SpecifyDouble("Extrusion height in actual Z", CMD_FacesToSolid.double_0, false, true, false, false);
                bool flag = false;
                while (!flag)
                {
                    CMD_FacesToSolid.string_2 = CommandLineQuerries.SpecifyString("Minimum projected edge length", CMD_FacesToSolid.string_2, false);
                    if (Convert.ToDouble(CMD_FacesToSolid.string_2) >= 0.0001 && Convert.ToDouble(CMD_FacesToSolid.string_2) <= 1.0)
                    {
                        flag = true;
                    }
                    else
                    {
                        editor.WriteMessage("\nValue must be between 0.0001 and 1.");
                    }
                }
                CMD_FacesToSolid.string_0 = CommandLineQuerries.KeywordYesNo("Union solids", CMD_FacesToSolid.string_0, false, false).ToUpper().Trim();
                this.method_0(objectId_, progressMeter, coordinateSystem);
            }
            catch (System.Exception ex)
            {
                progressMeter.Stop();
                editor.WriteMessage("\n" + ex.Message);
            }
        }
Exemplo n.º 2
0
        public void ContourCommand()
        {
            Editor editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            try
            {
                ObjectId[] objectId_ = CommandLineQuerries.SelectFaces(false);
                ContourLineComputation.string_0 = CommandLineQuerries.SpecifyReferencePlane(ContourLineComputation.string_0);
                CoordinateSystem coordinateSystem = CoordinateSystem.Global();
                if (ContourLineComputation.string_0 == "U")
                {
                    coordinateSystem = Conversions.GetUCS();
                }
                if (ContourLineComputation.string_0 == "3P")
                {
                    coordinateSystem = CommandLineQuerries.Specify3PSystem();
                }
                coordinateSystem.Orthonormalize();
                ContourLineComputation.startElevation = CommandLineQuerries.SpecifyDouble("Specify start elevation", ContourLineComputation.startElevation, false, true, false, true);
                ContourLineComputation.endElevation   = Math.Max(ContourLineComputation.endElevation, ContourLineComputation.startElevation);
                bool flag = false;
                while (!flag)
                {
                    ContourLineComputation.endElevation = CommandLineQuerries.SpecifyDouble("Specify end elevation", ContourLineComputation.endElevation, false, true, false, true);
                    if (ContourLineComputation.startElevation > ContourLineComputation.endElevation)
                    {
                        editor.WriteMessage("\nStart elevation must be less or equal end elevation.");
                    }
                    else
                    {
                        flag = true;
                    }
                }
                ContourLineComputation.spacing     = CommandLineQuerries.SpecifyDouble("Specify spacing", ContourLineComputation.spacing, false, false, false, false);
                ContourLineComputation.whatCADData = CommandLineQuerries.InsertOnLayer_Current_Face_Elevation_Index(ContourLineComputation.whatCADData);
                if (ContourLineComputation.whatCADData != "F" && ContourLineComputation.whatCADData != "C")
                {
                    ContourLineComputation.prefix = CommandLineQuerries.SpecifyPrefixString(ContourLineComputation.prefix);
                }
                this.genContour(objectId_, coordinateSystem);
            }
            catch (System.Exception ex)
            {
                editor.WriteMessage("\n" + ex.Message + "\n");
            }
        }