- UID
- 658062
- 积分
- 2147
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2008-10-22
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
In the .NET environment, a SelectionFilter is constructed with a TypedValue array.
A TypedValue can contain various Objects types in its Value property. The Object type is defined in the TypeCode property as an integer (or a DxfCode enum integer) which corresponds to the DXF group code of the Value.
For those who know AutoLISP, a TypedValue looks like a DXF dotted pair (even it is not the same thing, a dotted pair is a LISP specific data).
For the Values which type is String as entity type (DxfCode.Start = 0) or layer (DxfCode.Layer = 8), the Value can contain many patterns separted by commas and use wildcard patterns.
The filter can contain relational tests for the numerical values and logical grouping.
The more complete documentation in the AutoCAD Developer's Help for building sofisticated SelectionFilters is in the AutoLISP Help:
AutoLISP developer's Guide > Using the AutoLISP Language > Using AutoLISP to Manipulate AutoCAD Objects > Selection Set Handling > Selection Set Filter Lists
And the DXF group codes can be found in DXF Reference.
Here's an example to select closed polylines (lw, 2d and 3d) and closed ellipses on layers BASE and CONSTRUCTION TypedValue[] filter =
{ new TypedValue(-4, "<OR"),
new TypedValue(-4, "<AND"),
new TypedValue(0, "*POLYLINE"), // LWPOLYLINE and POLYLINE
new TypedValue(-4, "&"),
new TypedValue(70, 1), // Closed
new TypedValue(-4, "<NOT"),
new TypedValue(-4, "&"),
new TypedValue(70, 112), // Avoid meshes (bit codes: 16 + 32 + 64)
new TypedValue(-4, "NOT>"),
new TypedValue(-4, "AND>"),
new TypedValue(-4, "<AND"),
new TypedValue(0, "ELLIPSE"),
new TypedValue(-4, "="),
new TypedValue(41, 0.0), // Start parameter
new TypedValue(-4, "="),
new TypedValue(42, 6.283185307179586), // End parameter
new TypedValue(-4, "AND>"),
new TypedValue(-4, "OR>"),
new TypedValue(8, "BASE,CONSTRUCTION")};
SelectionFilter = new SelectionFilter(filter); |
|