コード例 #1
0
        public Point3d GetMaxPoint(ObjectId selectedOutline)
        {
            using (var t = _acad.StartOpenCloseTransaction())
            {
                var extents3D = t.GetObject(selectedOutline, OpenMode.ForRead, true, true).Bounds;
                if (extents3D != null)
                {
                    var bounds = extents3D.Value;
                    return(bounds.MaxPoint);
                }

                throw new InvalidOperationException("Não foi possível obter o ponto máximo do contorno.");
            }
        }
コード例 #2
0
ファイル: Strategy.cs プロジェクト: fafa-code/SlabAssembler
        protected void DebugPoint(Point3d point, Color color, int size)
        {
            var curUCSMatrix = _acad.WorkingDocument.Editor.CurrentUserCoordinateSystem;
            var curUCS       = curUCSMatrix.CoordinateSystem3d;

            using (var t = _acad.StartOpenCloseTransaction())
            {
                var blockTable = t.GetObject(_acad.Database.BlockTableId, OpenMode.ForRead) as BlockTable;
                var modelspace = t.GetObject(blockTable[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;

                using (var circle = new Circle(point, curUCS.Zaxis, size))
                {
                    circle.Layer = "0";
                    circle.Color = color;
                    modelspace?.AppendEntity(circle);
                    t.AddNewlyCreatedDBObject(circle, true);
                }

                t.Commit();
            }
        }