Method GetObjectsFiltered
GetObjectsFiltered(string)
Lists the objects of the scene on any level of hierarchy matching the given criteria expression.
Declaration
public IList<Scene.Object> GetObjectsFiltered(string filterExpression)
Parameters
Type | Name | Description |
---|---|---|
string | filterExpression | The filter expression to use. See remarks. |
Returns
Type | Description |
---|---|
IList<Scene.Object> | The list of the objects that have matched the given criteria. |
Remarks
This method is left for the compatibility with existing plugins. You can use LINQ queries on Objects to get much more flexibility and readability, though with some reasonable perfomance overhead.
The format of the filterExpression
parameter is the following:
Criterion1=value11|value12|..|value1N AND|OR
Criterion2=value21 Criterion3>=value31 AND|OR
Criterion4=value41
where the (Criterion, value) pairs are separated by the logical
operator AND or the logical operator OR. Criterion are the InfoType
numbers listed in the KD.SDK documentation of the ObjectGetInfo
function.
Catalog filename information for example is defined by
CATALOGFILENAME=0 InfoType value and the value of parameter can be
"KITCHENDRAW TUTORIAL" catalog (which has filename
@PM_CUIS.cat
):
0=@PM_CUIS
If several possible values are specified for a parameter,
they should be separated with |
sign. Thus,
0=@PM_CUIS|@K3
expression will return the list of the
objects that belong to eigher "KITCHEN TUTORIAL" or "KITCHEN &
BATHROOMS V3" catalog.
It is possible to define several type of relations between criteria and their corresponding values:
-
For the numerical criteria:
= "is equal" ( 12=500
)> "is greater than" ( 12>500
)>= "is not less than" ( 12>=500
)< "is less than" ( 12<500
)<= "is not greater than" ( 12<=500
)<> "is not equal" ( 12<>500
) -
For the textual criteria:
=text "is equal" ( 5=Base unit 1D
)=\*text "ends with" ( 5=\*1D
)=text\* "begins with" ( 5=Base\*
)=\*text\* "contains" ( 5=\*unit\*
)<>text "is not equal" ( 5<>Base unit 1D
)<>\*text "not ends with" ( 5<>\*1D
)<>text\* "not begins with" ( 5<>Base\*
)<>\*text\* "not contains" ( 5<>\*unit\*
)
The same criteria can be used several times. For example,
this expression will match any object that has width not less than
300 and not more than 500 at the same time: 12>=300 AND
12<=500