当前位置:   article > 正文

6基于C#的CAD二次开发-对象选择(通过范围选择对象)_c# autocad 选择集

c# autocad 选择集

1 程序界面

在这里插入图片描述

2 主要程序段

所有程序段都经过调试,能正常使用。如有疑问,请自行调试后再使用。

2.1 选择所有实体

        /// <summary>
        /// 选择所有实体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            PromptSelectionResult psr = ed.SelectAll();
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                    ObjectId a11 = tr.GetObject(objectId1, OpenMode.ForRead).OwnerId;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = tr.GetObject(a11, OpenMode.ForRead).GetType().Name;
                }
               ObjectId objectId6=  ed.CurrentViewportObjectId;
                Viewport entity6 = tr.GetObject(objectId6, OpenMode.ForRead) as Viewport;
                MessageBox.Show(entity6.Width.ToString());
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36

2.2 在图形中选择实体

        /// <summary>
        /// 在图形中选择实体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            ed.WriteMessage("\n请框选对象\n");
            PromptSelectionResult psr = ed.GetSelection();
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                }
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

2.3 由选择多点组成一个多边形区域,选择多边形区域中及和多边形相交的实体

        /// <summary>
        /// 由选择多点组成一个多边形区域,选择多边形区域中及和多边形相交的实体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;

            //通过选择点创建多边形,选择的点不能封闭,连成的线不能自相交
            Point3dCollection pt3dCol = new Point3dCollection();
            for (int i = 0; i < 5; i++)
            {
                PromptPointOptions pPtOpts = new PromptPointOptions("");
                // 提示起点
                pPtOpts.Message = "\n选择多边形第"+(i+1).ToString()+"点\n";
                PromptPointResult psrP = ed.GetPoint(pPtOpts);
                pt3dCol.Add(psrP.Value);
            }

            //通过多边形选择,选择范围为和该多边形相交以及该多边形内部的对象
            PromptSelectionResult psr = ed.SelectCrossingPolygon(pt3dCol);
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                }
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44

2.4 通过两点连线为对角线构建一个四边形,选择该四边形的边界和四边形内的对象

        /// <summary>
        /// 通过两点连线为对角线构建一个四边形,选择该四边形的边界和四边形内的对象
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button4_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
      

            PromptPointOptions pPtOpts = new PromptPointOptions("");
            // 提示起点
            pPtOpts.Message = "\n选择第1点";
            PromptPointResult psrP = ed.GetPoint(pPtOpts);
            Point3d point3D1 = psrP.Value;
            pPtOpts.Message = "\n选择第2点";
            psrP = ed.GetPoint(pPtOpts);
            Point3d point3D2 = psrP.Value;


            PromptSelectionResult psr = ed.SelectCrossingWindow(point3D1, point3D2);
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                }
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43

2.5 栏选

        /// <summary>
        /// 栏选。和SelectCrossingPolygon不同。该方法由多点组成一条曲线,只选择和该曲线相交的对象。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button5_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;

            //通过选择点创建多边形,选择的点不能封闭,连成的线不能自相交
            Point3dCollection pt3dCol = new Point3dCollection();
            for (int i = 0; i < 5; i++)
            {
                PromptPointOptions pPtOpts = new PromptPointOptions("");
                // 提示起点
                pPtOpts.Message = "\n选择多边形第" + (i + 1).ToString() + "点\n";
                PromptPointResult psrP = ed.GetPoint(pPtOpts);
                pt3dCol.Add(psrP.Value);
            }

            //通过多边形选择,选择范围为和该多边形相交以及该多边形内部的对象
            PromptSelectionResult psr = ed.SelectFence(pt3dCol);
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                }
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44

2.6 选择当前图形中已经选择的实体

        /// <summary>
        /// 选择当前图形中已经选择的实体。意思是指手动在CAD界面中选择实体后,
        /// 用该命令可以将手动选择的实体添加到程序的ObjectId数组中,以便程序对手动选择的实体进行后续操作。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button6_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            PromptSelectionResult psr = ed.SelectImplied();
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                }
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

2.7 选择图形中最后绘制的实体

       /// <summary>
        /// 选择图形中最后绘制的实体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button7_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            PromptSelectionResult psr = ed.SelectLast();
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                }
            }
        }

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

2.8 选择上一个选择集

        /// <summary>
        /// 选择上一个选择集
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button8_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            PromptSelectionResult psr = ed.SelectPrevious();
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                }
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

2.9 在图形中选择实体

       private void button9_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;


            PromptPointOptions pPtOpts = new PromptPointOptions("");
            // 提示起点
            pPtOpts.Message = "\n选择第1点";
            PromptPointResult psrP = ed.GetPoint(pPtOpts);
            Point3d point3D1 = psrP.Value;
            pPtOpts.Message = "\n选择第2点";
            psrP = ed.GetPoint(pPtOpts);
            Point3d point3D2 = psrP.Value;


            PromptSelectionResult psr = ed.SelectWindow(point3D1, point3D2);
            if (psr.Status != PromptStatus.OK)
            {
                ed.WriteMessage("\n未选择任何对象。\n");
                return;
            }
            SelectionSet sSet = psr.Value;
            ObjectId[] selectedIds = sSet.GetObjectIds();  // 获取选择对象的ObjectiID数组.
            using (Transaction tr = doc.Database.TransactionManager.StartTransaction())
            {
                foreach (ObjectId objectId1 in selectedIds)
                {
                    //将获取的ObjectId转换为具体的实体Entity
                    Entity entity1 = tr.GetObject(objectId1, OpenMode.ForRead) as Entity;
                    //将实体Entity的有关信息显示在交互界面的表格
                    int index = dataGridView1.Rows.Add();
                    dataGridView1.Rows[index].Cells["对象类型"].Value = entity1.GetType().Name;
                    dataGridView1.Rows[index].Cells["ObjectId"].Value = entity1.ObjectId.ToString();
                }
            }
        }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38

3 编辑器类Editor

实体的选择主要在编辑器类Editor中进行。该类和文档相关,如用在内存中打开文件,且文件不显示的方式打开文档(即后台打开CAD文件),则该类不能在,须通过其他的方式进行对象的选择。

3.1 Editor类库基本信息

基本信息基本信息内容
类名称:Editor
类全称:Autodesk.AutoCAD.EditorInput.Editor
命名空间:Autodesk.AutoCAD.EditorInput
所属文件:C:\Program Files\Autodesk\AutoCAD 2019\accoremgd.dll
基类:System.MarshalByRefObject

3.2 Editor类库方法

方法名称返回类型是否公共函数是否静态函数
ApplyCurDwgLayerTableChanges()VoidTrueFalse
Command(Object[] parameter)VoidTrueFalse
CommandAsync(Object[] parameter)CommandResultTrueFalse
CreateObjRef(Type requestedType)ObjRefTrueFalse
DoPrompt(PromptOptions opt)PromptResultTrueFalse
Drag(PromptDragOptions options)PromptPointResultTrueFalse
Drag(SelectionSet selection,String message,DragCallback callback)PromptPointResultTrueFalse
Drag(Jig jig)PromptResultTrueFalse
DrawVector(Point3d from,Point3d to,Int32 color,Boolean drawHighlighted)VoidTrueFalse
DrawVectors(ResultBuffer rb,Matrix3d transform)VoidTrueFalse
Equals(Object obj)BooleanTrueFalse
GetAngle(PromptAngleOptions options)PromptDoubleResultTrueFalse
GetAngle(String message)PromptDoubleResultTrueFalse
GetCommandVersion()Int32TrueFalse
GetCorner(PromptCornerOptions options)PromptPointResultTrueFalse
GetCorner(String message,Point3d basePoint)PromptPointResultTrueFalse
GetCurrentView()ViewTableRecordTrueFalse
GetDistance(PromptDistanceOptions options)PromptDoubleResultTrueFalse
GetDistance(String message)PromptDoubleResultTrueFalse
GetDouble(PromptDoubleOptions options)PromptDoubleResultTrueFalse
GetDouble(String message)PromptDoubleResultTrueFalse
GetEntity(PromptEntityOptions options)PromptEntityResultTrueFalse
GetEntity(String message)PromptEntityResultTrueFalse
GetFileNameForOpen(PromptOpenFileOptions options)PromptFileNameResultTrueFalse
GetFileNameForOpen(String message)PromptFileNameResultTrueFalse
GetFileNameForSave(PromptSaveFileOptions options)PromptFileNameResultTrueFalse
GetFileNameForSave(String message)PromptFileNameResultTrueFalse
GetHashCode()Int32TrueFalse
GetInteger(PromptIntegerOptions options)PromptIntegerResultTrueFalse
GetInteger(String message)PromptIntegerResultTrueFalse
GetKeywords(PromptKeywordOptions options)PromptResultTrueFalse
GetKeywords(String message,String[] globalKeywords)PromptResultTrueFalse
GetLifetimeService()ObjectTrueFalse
GetNestedEntity(PromptNestedEntityOptions options)PromptNestedEntityResultTrueFalse
GetNestedEntity(String message)PromptNestedEntityResultTrueFalse
GetPoint(PromptPointOptions options)PromptPointResultTrueFalse
GetPoint(String message)PromptPointResultTrueFalse
GetSelection(PromptSelectionOptions options,SelectionFilter filter)PromptSelectionResultTrueFalse
GetSelection(PromptSelectionOptions options)PromptSelectionResultTrueFalse
GetSelection(SelectionFilter filter)PromptSelectionResultTrueFalse
GetSelection()PromptSelectionResultTrueFalse
GetString(PromptStringOptions options)PromptResultTrueFalse
GetString(String message)PromptResultTrueFalse
GetType()TypeTrueFalse
GetViewportNumber(Point point)Int32TrueFalse
InitCommandVersion(Int32 nVersion)Int32TrueFalse
InitializeLifetimeService()ObjectTrueFalse
PointToScreen(Point3d pt,Int32 viewportNumber)PointTrueFalse
PointToWorld(Point pt,Int32 viewportNumber)Point3dTrueFalse
PointToWorld(Point pt)Point3dTrueFalse
PostCommandPrompt()VoidTrueFalse
Regen()VoidTrueFalse
SelectAll(SelectionFilter filter)PromptSelectionResultTrueFalse
SelectAll()PromptSelectionResultTrueFalse
SelectCrossingPolygon(Point3dCollection polygon,SelectionFilter filter)PromptSelectionResultTrueFalse
SelectCrossingPolygon(Point3dCollection polygon)PromptSelectionResultTrueFalse
SelectCrossingWindow(Point3d pt1,Point3d pt2,SelectionFilter filter,Boolean forceSubEntitySelection)PromptSelectionResultTrueFalse
SelectCrossingWindow(Point3d pt1,Point3d pt2,SelectionFilter filter)PromptSelectionResultTrueFalse
SelectCrossingWindow(Point3d pt1,Point3d pt2)PromptSelectionResultTrueFalse
SelectFence(Point3dCollection fence,SelectionFilter filter)PromptSelectionResultTrueFalse
SelectFence(Point3dCollection fence)PromptSelectionResultTrueFalse
SelectImplied()PromptSelectionResultTrueFalse
SelectLast()PromptSelectionResultTrueFalse
SelectPrevious()PromptSelectionResultTrueFalse
SelectWindow(Point3d pt1,Point3d pt2,SelectionFilter filter)PromptSelectionResultTrueFalse
SelectWindow(Point3d pt1,Point3d pt2)PromptSelectionResultTrueFalse
SelectWindowPolygon(Point3dCollection polygon,SelectionFilter filter)PromptSelectionResultTrueFalse
SelectWindowPolygon(Point3dCollection polygon)PromptSelectionResultTrueFalse
SetCurrentView(ViewTableRecord value)VoidTrueFalse
SetImpliedSelection(SelectionSet selectionSet)VoidTrueFalse
SetImpliedSelection(ObjectId[] selectedObjects)VoidTrueFalse
Snap(String snapMode,Point3d input)Point3dTrueFalse
StartUserInteraction(IntPtr hwnd)EditorUserInteractionTrueFalse
StartUserInteraction(Window window)EditorUserInteractionTrueFalse
SwitchToModelSpace()VoidTrueFalse
SwitchToPaperSpace()VoidTrueFalse
ToString()StringTrueFalse
TraceBoundary(Point3d seedPoint,Boolean detectIslands)DBObjectCollectionTrueFalse
TurnForcedPickOff()Int32TrueFalse
TurnForcedPickOn()Int32TrueFalse
TurnSubentityWindowSelectionOff()VoidTrueFalse
TurnSubentityWindowSelectionOn()VoidTrueFalse
UpdateScreen()VoidTrueFalse
UpdateTiledViewportsFromDatabase()VoidTrueFalse
UpdateTiledViewportsInDatabase()VoidTrueFalse
ViewportIdFromNumber(Int32 viewportNumber)ObjectIdTrueFalse
WriteMessage(String message,Object[] parameter)VoidTrueFalse
WriteMessage(String message)VoidTrueFalse

3.3 Editor类库属性

属性名称属性类型是否可写
ActiveViewportIdAutodesk.AutoCAD.DatabaseServices.ObjectIdFalse
CurrentUserCoordinateSystemAutodesk.AutoCAD.Geometry.Matrix3dTrue
CurrentViewportObjectIdAutodesk.AutoCAD.DatabaseServices.ObjectIdFalse
DocumentAutodesk.AutoCAD.ApplicationServices.DocumentFalse
IsDraggingSystem.BooleanFalse
IsQuiescentSystem.BooleanFalse
IsQuiescentForTransparentCommandSystem.BooleanFalse
MouseHasMovedSystem.BooleanFalse
UseCommandLineInterfaceSystem.BooleanFalse
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/114283
推荐阅读
相关标签
  

闽ICP备14008679号