示例#1
0
        public static void fCWall()
        {
            Utils.Utils.Init();
            Document doc = acApp.DocumentManager.MdiActiveDocument;
            Database db  = doc.Database;
            Editor   ed  = acApp.DocumentManager.MdiActiveDocument.Editor;

            BulgePolyJig jig = new BulgePolyJig(ed.CurrentUserCoordinateSystem);

            // Get zMin & zMax | height level
            PromptDoubleOptions zMinO = new PromptDoubleOptions("\nEnter Z-min level:");

            zMinO.DefaultValue = zMinOld;
            PromptDoubleResult zMin = ed.GetDouble(zMinO);

            if (zMin.Status != PromptStatus.OK)
            {
                Utils.Utils.End(); return;
            }
            zMinOld = zMin.Value;
            Utils.Utils.SetUCS(zMin.Value);

            if (!Utils.Layers.CurrentLayer().Contains("OBST"))
            {
                Utils.Layers.SetLayerForCurrentFloor("!FDS_OBST[gypsum_board]");
            }

            while (true)
            {
                PromptResult res = ed.Drag(jig);
                switch (res.Status)
                {
                // New point was added, keep going
                case PromptStatus.OK:
                    jig.AddDummyVertex();
                    break;

                // Keyword was entered
                case PromptStatus.Keyword:
                    if (jig.IsUndoing)
                    {
                        jig.RemoveLastVertex();
                    }
                    break;

                // If the jig completed successfully, add the polyline
                case PromptStatus.None:
                    jig.RemoveLastVertex();
                    jig.Append();
                    // Wyciagniecie geometrii
                    jig.ExtrudeToCeiling(zMin.Value);
                    Utils.Utils.End();
                    return;

                // User cancelled the command, get out of here
                // and don't forget to dispose the jigged entity
                default:
                    jig.Entity.Dispose();
                    Utils.Utils.End();
                    return;
                }
            }
        }