[CommandMethod("PickPoint")]
static public void PickPoint()
{
//获取 Editor 对象
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
PromptPointOptions promptPtOp = new PromptPointOptions("选择一个点:");
//指定的基点,如果指定了该点,则在选择的时候绘制一条橡皮线。
promptPtOp.BasePoint = new Autodesk.AutoCAD.Geometry.Point3d(0, 0, 0);
PromptPointResult resPt;
resPt = ed.GetPoint(promptPtOp);
if (resPt.Status == PromptStatus.OK)
{
ed.WriteMessage("选择的点为:" + resPt.Value.ToString());
}
}
//--------------------------------------------------------------
// 功能:获取选择集
// 作者:
// 日期:2007-7-20
// 说明:
//
//----------------------------------------------------------------
[CommandMethod("SelectEnt")]
static public void SelectEnt()
{
//获取 Editor 对象
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
PromptSelectionOptions selectionOp = new PromptSelectionOptions();
PromptSelectionResult ssRes = ed.GetSelection(selectionOp);
if (ssRes.Status == PromptStatus.OK)
{
SelectionSet SS = ssRes.Value;
int nCount = SS.Count;
ed.WriteMessage("选择了{0}个实体" , nCount);
}
}
//--------------------------------------------------------------
// 功能:获取选择集(带过滤)
// 作者:
// 日期:2007-7-20
// 说明:
//
//----------------------------------------------------------------
评论8
最新资源