- 积分
- 6653
- 明经币
- 个
- 注册时间
- 2006-8-30
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
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
{
[CommandMethod("SEL")]
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")
});
|
|