Esempio n. 1
0
        cmdA()
        {
            PromptStatus ps;
            Point3d      pnt3dBeg = UserInput.getPoint("\nSelect First Point: ", out ps, osMode: 0);

            if (ps != PromptStatus.OK)
            {
                return;
            }
            Color color = Misc.getColorByLayer();

            ObjectId idLdr = BB_JigSplineArrow.jigSplineArrow(pnt3dBeg, 0.09, "ARROW", color);
        }
Esempio n. 2
0
        jigSplineArrow(Point3d pnt3dFirst, double txtSize, string nameLayer, Color color)
        {
            ObjectId idLDR = ObjectId.Null;
            Editor   ed    = BaseObjs._editor;

            BB_JigSplineArrow jig = new BB_JigSplineArrow(pnt3dFirst, txtSize, nameLayer, color);

            bool bSuccess = true, bComplete = false;
            int  pntCount = 0;

            while (bSuccess && !bComplete)
            {
                _mIsJigStarted = false;

                PromptResult dragres = ed.Drag(jig);

                bSuccess = (dragres.Status == PromptStatus.OK);
                if (bSuccess)
                {
                    jig.addVertex();
                    pntCount++;
                }

                bComplete = (dragres.Status == PromptStatus.None || pntCount == 4);
            }

            if (bComplete)
            {
                try
                {
                    using (Transaction tr = BaseObjs.startTransactionDb())
                    {
                        BlockTableRecord ms  = Blocks.getBlockTableRecordMS();
                        Leader           ldr = (Leader)jig.getEntity();

                        idLDR = ms.AppendEntity(ldr);
                        tr.AddNewlyCreatedDBObject(ldr, true);
                        tr.Commit();
                    }
                }
                catch (System.Exception ex)
                {
                    BaseObjs.writeDebug(ex.Message + " BB_JigSplineArrow.cs: line: 88");
                }
            }
            return(idLDR);
        }