Filter (TrackCollection)
Description
Returns a subset of this collection as a new collection of objects matching the filter criteria. If no items are found, Filter returns "Nothing", which allows you to trap errors.
You can set up the filter criteria by using the 'Type', 'Families', and/or 'Path' parameters which roughly correspond to searching by type as outlined in the siType constant, searching by family as outlined in the siFamily constant, or searching by name of the object (see Object Name for more about valid syntax for the Path parameter).
Note: If you combine these parameters, they will narrow the scope of your search, not broaden it. For example, if you specify 'Nurbs Surface Mesh Geometries' (siNurbsSurfaceMeshFamily) for the Families parameter and 'Cone*' for the Path parameter, the return collection will contain any Nurbs cone that was in the original collection, but no Polygon Mesh cones and no Nurbs cubes, spheres, etc.
Scripting Syntax
TrackCollection.Filter( [Type], [Families], [Path] )
C# Syntax
TrackCollection TrackCollection.Filter( String in_filter, Object in_famArray, String in_path );Parameters
|
Parameter |
Type |
Description |
|
Type |
siType (for example, "Model", "cube", "torus", etc.). Providing a type argument is equivalent to testing each object with the ProjectItem.IsKindOf method. Default Value: Empty string |
|
|
Families |
Specifies the families that objects must belong to. To match the filter, an object must belong to at least one of the specified families. Default Value: Empty Variant |
|
|
Path |
An Object Name. This can be a partial name using wildcards. For example, "a*" returns all matches that begin with the character "a". Default Value: Empty string |
Return Value
Collection of objects (subset of original collection).
Examples
• See TrackCollection.Filter.1.vbs
• See TrackCollection.Filter.2.pys
• See TrackCollection.Filter.3.js
• See TrackCollection.Filter.4.pys
Autodesk Softimage 2011