请教为何无法选择?
using Autodesk.AutoCAD.Runtime;using Autodesk.AutoCAD.EditorInput;
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Geometry;
using Application = Autodesk.AutoCAD.ApplicationServices.Application;
using Document = Autodesk.AutoCAD.ApplicationServices.Document;
using System.Linq;
using System.Diagnostics;
namespace ClassLibrary5
{
public class Class1
{
public void sel()
{
Autodesk.AutoCAD.EditorInput.Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
SelectionFilter acSelFtr = new SelectionFilter(new TypedValue[] {
new TypedValue((int)DxfCode.Operator, "<or"),
new TypedValue((int)DxfCode.Start, "DIMENSION") ,
new TypedValue((int)DxfCode.Start, "insert") ,
new TypedValue((int)DxfCode.Operator, ">or")
});
PromptSelectionResult res2 = ed.GetSelection(acSelFtr);
if (res2.Status != PromptStatus.OK)
{
return;
}
else
{
ed.SetImpliedSelection(res2.Value.GetObjectIds());
}
}
}
}
加载后,运行SEL,命令不执行,如果我把过滤条件改成单个,可以正常选择,请教老大们是哪里出了问题?
SelectionFilter acSelFtr = new SelectionFilter(new TypedValue[] {
new TypedValue((int)DxfCode.Start, "DIMENSION")
});
哎原来是这句写错了new TypedValue((int)DxfCode.Operator, ">or"); 应该是"or>"!我这个大晕蛋
页:
[1]