Example #1
0
File: Db.cs Project: 15831944/EM
        makePointEnt(Point3d pt, int colorIndex, Database db)
        {
            int mode = (int)AcadApp.GetSystemVariable("pdmode");

            if (mode == 0)
            {
                AcadApp.SetSystemVariable("pdmode", 99);
            }

            try
            {
                using (Transaction tr = BaseObjs.startTransactionDb())
                {
                    using (DBPoint dbPt = new DBPoint(pt))
                    {
                        dbPt.ColorIndex = colorIndex;
                        SymTbl.AddToCurrentSpace(dbPt, db);
                    }
                    tr.Commit();
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " Db.cs: line: 431");
            }
        }
Example #2
0
File: Db.cs Project: 15831944/EM
        makeRayEnt(Point3d basePt, Vector3d unitDir, int colorIndex, Database db)
        {
            if (unitDir.IsZeroLength())
            {
                Editor ed = BaseObjs._editor;
                ed.WriteMessage("\nSkipping zero length vector (colorIndex = {0:d})", colorIndex);
                return;
            }

            try
            {
                using (Ray ray = new Ray())
                {
                    ray.ColorIndex = colorIndex;
                    ray.BasePoint  = basePt;
                    ray.UnitDir    = unitDir;
                    SymTbl.AddToCurrentSpace(ray, db);
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " Db.cs: line: 457");
            }
        }