请问选择单个实体时如何设置过滤
请问选择单个实体时如何设置过滤?谢谢public static void Test2()
{
var db = HostApplicationServices.WorkingDatabase;
var doc = Application.DocumentManager.GetDocument(db);
var ed = doc.Editor;
var optSel = new PromptSelectionOptions();
optSel.MessageForAdding = "\n选择直线(方法一):";
optSel.SingleOnly = true;
var resSel = ed.GetSelection(optSel, new SelectionFilter(new TypedValue[] { new TypedValue(0, "line") }));
var optEnt = new PromptEntityOptions("\n选择直线(方法二):");
optEnt.SetRejectMessage("错误的选择!");
optEnt.AddAllowedClass(typeof(Line), false);
var resEnt = ed.GetEntity(optEnt);
} 多谢!
方法一没有什么问题,
方法二中typeof(Line)在VB.net中要怎么处理啊? optEnt.AddAllowedClass(GetType(Line), False) 谢谢,搞定,收工. 新手学习了!
页:
[1]