Exemplo n.º 1
0
        public void CMD_PosLength()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            PromptSelectionResult selresult = DWGUtility.SelectAllPosUser();

            if (selresult.Status != PromptStatus.OK)
            {
                return;
            }

            PromptKeywordOptions opts = new PromptKeywordOptions("L boyunu [Göster/giZle]: ", "Show Hide");

            opts.AllowNone = false;
            PromptResult result = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.GetKeywords(opts);

            if (result.Status == PromptStatus.OK)
            {
                switch (result.StringResult)
                {
                case "Show":
                    ShowPosLength(selresult.Value.GetObjectIds(), true);
                    break;

                case "Hide":
                    ShowPosLength(selresult.Value.GetObjectIds(), false);
                    break;
                }
            }
        }
Exemplo n.º 2
0
        public void CMD_IncludePos()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            PromptSelectionResult selresult = DWGUtility.SelectAllPosUser();

            if (selresult.Status != PromptStatus.OK)
            {
                return;
            }

            PromptKeywordOptions opts = new PromptKeywordOptions("Metraja [Dahil et/metrajdan Cikar]: ", "Add Remove");

            opts.AllowNone = false;
            PromptResult result = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.GetKeywords(opts);

            if (result.Status == PromptStatus.OK)
            {
                switch (result.StringResult)
                {
                case "Add":
                    IcludePosinBOQ(selresult.Value.GetObjectIds(), true);
                    break;

                case "Remove":
                    IcludePosinBOQ(selresult.Value.GetObjectIds(), false);
                    break;
                }
            }
        }
Exemplo n.º 3
0
        public void CMD_BOQEdit()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            Autodesk.AutoCAD.EditorInput.Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            // Edit entity if there is a pickset
            PromptSelectionResult selectionRes = ed.SelectImplied();

            if (selectionRes.Status != PromptStatus.Error && selectionRes.Value.Count > 0)
            {
                ObjectId id = selectionRes.Value[0].ObjectId;
                ed.SetImpliedSelection(new ObjectId[0]);
                ItemEdit(id, MonitoredPoint);
                return;
            }

            PromptEntityOptions opts = new PromptEntityOptions("Select entity: ");

            opts.AllowNone = false;
            PromptEntityResult result = ed.GetEntity(opts);

            if (result.Status == PromptStatus.OK)
            {
                ItemEdit(result.ObjectId, result.PickedPoint);
            }
        }
Exemplo n.º 4
0
        public void CMD_DrawBOQ()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            DrawBOQ();
        }
Exemplo n.º 5
0
        public void CMD_PosGroups()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            PosGroups();
        }
Exemplo n.º 6
0
        public void CMD_PosUpgrade()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            PosUpgrade();
        }
Exemplo n.º 7
0
        public void CMD_FindReplace()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            FindReplace(true);
        }
Exemplo n.º 8
0
        public void CMD_PosShapes()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            PosShapes();
        }
Exemplo n.º 9
0
        public void CMD_CopyPosDetail()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            CopyPosDetail();
        }
Exemplo n.º 10
0
        public void CMD_CopyPosNumber()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            CopyPosNumber();
        }
Exemplo n.º 11
0
        public void CMD_EmptyBalloons()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            EmptyBalloons();
        }
Exemplo n.º 12
0
        public void CMD_NumberPos()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            NumberPos();
        }
Exemplo n.º 13
0
        public void CMD_NewPos()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            NewPos();
        }
Exemplo n.º 14
0
        public void CMD_TableStyle()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            TableStyles();
        }
Exemplo n.º 15
0
        public void CMD_PosExplode()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            PosExplode();
        }
Exemplo n.º 16
0
        public void CMD_ToggleShapes()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            ShowShapes = !ShowShapes;
            DWGUtility.RefreshAllPos();
        }
Exemplo n.º 17
0
        public void CMD_HideShapes()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            ShowShapes = false;
            DWGUtility.RefreshAllPos();
        }
Exemplo n.º 18
0
        public void CMD_PosLicense()
        {
            CheckLicense.LicenseInformation();

            Autodesk.AutoCAD.ApplicationServices.Application.DisplayTextScreen = true;

            PromptKeywordOptions opts = new PromptKeywordOptions("Lisansınızı değiştirmek istiyor musunuz? [Evet/Hayır]: ", "Yes No");

            opts.AllowNone = false;
            PromptResult result = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.GetKeywords(opts);

            if (result.Status == PromptStatus.OK)
            {
                if (result.StringResult == "Yes")
                {
                    CheckLicense.Request();
                }
            }
        }
Exemplo n.º 19
0
        public void CMD_LastPosNumber()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            PromptSelectionResult sel = DWGUtility.SelectAllPosUser();

            if (sel.Status != PromptStatus.OK)
            {
                return;
            }
            ObjectId[] items = sel.Value.GetObjectIds();

            int lastNum = GetLastPosNumber(items);

            if (lastNum != -1)
            {
                MessageBox.Show("Son poz numarası: " + lastNum.ToString(), "RebarPos", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 20
0
        // The CommandMethod attribute can be applied to any public  member
        // function of any public class.
        // The function should take no arguments and return nothing.
        // If the method is an instance member then the enclosing class is
        // instantiated for each document. If the member is a static member then
        // the enclosing class is NOT instantiated.
        //
        // NOTE: CommandMethod has overloads where you can provide helpid and
        // context menu.
        public MyCommands()
        {
            Autodesk.AutoCAD.EditorInput.Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
            ed.PointMonitor += new PointMonitorEventHandler(ed_PointMonitor);
            MonitoredPoint   = Point3d.Origin;

            SetCurrentGroup();
            ReadUserPosShapes();
            ReadUserTableStyles();

            ShowShapes = false;

            // Load prompt
            string heading = "Donatı Pozlandırma ve Metraj Programı v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(2) + " yüklendi.";

            ed.WriteMessage("\n");
            ed.WriteMessage(heading);
            ed.WriteMessage("\n");
            ed.WriteMessage(new string('=', heading.Length));
            PosCategories();

            // License information
            CheckLicense.LicenseInformation();
        }
Exemplo n.º 21
0
        public void CMD_Pos()
        {
            if (!CheckLicense.Check())
            {
                return;
            }

            Autodesk.AutoCAD.EditorInput.Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

            // Edit entity if there is a pickset
            PromptSelectionResult selectionRes = ed.SelectImplied();

            if (selectionRes.Status != PromptStatus.Error && selectionRes.Value.Count > 0)
            {
                ObjectId id = selectionRes.Value[0].ObjectId;
                ed.SetImpliedSelection(new ObjectId[0]);
                ItemEdit(id, MonitoredPoint);
                return;
            }

            bool cont = true;

            while (cont)
            {
                PromptEntityOptions opts = new PromptEntityOptions("Poz secin veya [Yeni/Numaralandir/Kopyala/kOntrol/Metraj/bul Degistir/numara Sil/Acilimlar/Tablo stili/ayaRlar]: ",
                                                                   "New Numbering Copy Check BOQ Find Empty Shapes Table Preferences");
                opts.AllowNone = false;
                PromptEntityResult result = ed.GetEntity(opts);

                if (result.Status == PromptStatus.Keyword)
                {
                    switch (result.StringResult)
                    {
                    case "New":
                        NewPos();
                        break;

                    case "Numbering":
                        NumberPos();
                        break;

                    case "Empty":
                        EmptyBalloons();
                        break;

                    case "Copy":
                        CopyPos();
                        break;

                    case "Check":
                        PosCheck();
                        break;

                    case "BOQ":
                        DrawBOQ();
                        break;

                    case "Find":
                        FindReplace(false);
                        break;

                    case "Shapes":
                        PosShapes();
                        break;

                    case "Table":
                        TableStyles();
                        break;

                    case "Preferences":
                        PosGroups();
                        break;
                    }
                    cont = false;
                }
                else if (result.Status == PromptStatus.OK)
                {
                    ItemEdit(result.ObjectId, result.PickedPoint);
                    cont = true;
                }
                else
                {
                    cont = false;
                }
            }
        }