几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(VB.NET/C#) (http://www.dimcax.com/hust/forumdisplay.php?f=176)
-   -   过滤器使用通配符来实现模糊选择集 (http://www.dimcax.com/hust/showthread.php?t=10138)

yang686526 2009-04-22 03:02 PM

过滤器使用通配符来实现模糊选择集
 
过滤器使用通配符来实现模糊选择集
www.dimcax.com
过滤器使用通配符来实现模糊选择集
, ,
例: 层名包含"ping"的所有层的直线。(是直线并且所在层的层名称字符含有“ping“) 
typedvalue[] ftv = new typedvalue[]
{
new typedvalue((int)dxfcode.operator , "<and"),
new typedvalue((int)dxfcode.start, "line") ,
new typedvalue((int)dxfcode.layername, "*ping*"),
new typedvalue((int)dxfcode.operator , "and>")
};
selectionfilter sf= new selectionfilter(ftv);
全码:
public objectid[] getdocumentents( )//模糊选择过滤集
{
using (documentlock doclock = autodesk.autocad.applicationservices.application.documentmanager.mdiactivedocument.lockdocument())
{
editor ed = autodesk.autocad.applicationservices.application.documentmanager.mdiactivedocument.editor;

typedvalue[] ftv = new typedvalue[]
{
new typedvalue((int)dxfcode.operator , "<and"),
new typedvalue((int)dxfcode.start, "line") ,
new typedvalue((int)dxfcode.layername, "*ping*"),
new typedvalue((int)dxfcode.operator , "and>")
};
selectionfilter sf = new selectionfilter(ftv);
promptselectionresult sp = ed.selectall(sf);
if (sp.status != promptstatus.ok)
{
return new objectid[0] ;
}
else
{
return sp.value.getobjectids();
}

}
}
复制代码
new typedvalue((int)dxfcode.operator , "<and")
new typedvalue((int)dxfcode.operator , "and>")
好像可以省略?


所有的时间均为北京时间。 现在的时间是 05:18 AM.