Search Functions  

Query  

Query()
Function used to search for the features located below the feature to which it applies and that verifies the specified expression and that adds these features to the list. 
In the example below, the result of the search will return the holes of PartBody whose diameters are greater than 50mm.
Example: List.1=PartBody.Query("Hole","x.Diameter>50mm") (Note that the expression can be empty.)
Where:
  • List.1 is the name of the list on which the calculation will be performed.
  • PartBody is the body on which the search will be carried out
  • Hole is the Type of the searched feature.
  • x.Diameter>50mm is the expression.
In an assembly context, if you perform a query on a type deriving from the type Product or on a type assigned to a product (like electrical types for example), the query will return more items than expected because all the product instances (even those that are not visible) are returned as well as their references.

Find

Feature->Find (type: String, expression: String, Down : Boolean): Undefined type
Function used to find an object that is either a child or a parent, that is of a given type, and that fulfills a condition. It stops when it finds the first object.

Where:
The argument Down asks if you are interested in the children or the fathers:

  • When going up, the scan stops at the document border.
    • Starting from a mechanical feature, it stops at the PartFeature.
    • Starting from an product instance, it does not go upper than the product that owns it.
    • Starting from a product reference, it means nothing.
  • When going down, all the children in the tree are scanned and in the case of a product, it crosses the instance/reference border.

Example:

Part->Find("x.Height > 20mm", "Pad", true)

 

Access  

Feature->Access (path: String, type : String) : UndefinedType
Function used to return an object from a path. In this case, you know the location of what you are looking for.

Example:

Part->Access("PartBody\\Pad.1", "Pad")

Where:

  • "PartBody.1\\Pad.1" is the path.

Note that the separator is "\\".