SaveSearchRule
- class SaveSearchRule(application_type: RuleApplicationType | Evaluatable[RuleApplicationType], query: ShapeQuery, variable_to_save_to: str)
A
SaveSearchRuleis like aSearchRule, but instead of selecting the chosen match(es), the chosen match(es) are saved to a variable indynamic_evaluation_context.- Parameters:
application_type – The
RuleApplicationTypeto use when searching.query – The
ShapeQueryto use when searching.variable_to_save_to – The name of the variable to save the search results to.
Attributes
The
RuleApplicationTypeto use when selecting a match to apply the rule to.Methods
- apply_to(shape: Shape, communication_layer: CommunicationLayer, in_automation: bool = False, _to_design: ndarray = array([0., 0., 0.])) Tuple[Rule, List[Tuple[Shape, Shape]], Shape, Shape, Shape, Shape]
-
- Parameters:
shape – The shape to apply this rule to.
communication_layer – The
CommunicationLayerto use during rule application.in_automation – Whether this rule is being applied as part of an automation (e.g.: as part of a
RuleSequenceorProgram)._to_design – Vector used to relocate the matches to the design in application previews and enumerations. This is needed because the
ShapeMachineengine internally shifts itsinitial_designto the origin to reduce floating-point error.
- Returns:
The shape created as a result of rule application.
- application_type
The
RuleApplicationTypeto use when selecting a match to apply the rule to.