[CommandMethod("t2")]
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);