User Tools

Site Tools


visual3d:documentation:pipeline:pipeline_commands:set_pipeline_parameter_from_expression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:pipeline:pipeline_commands:set_pipeline_parameter_from_expression [2024/06/19 12:52] sgrangervisual3d:documentation:pipeline:pipeline_commands:set_pipeline_parameter_from_expression [2026/02/06 21:01] (current) wikisysop
Line 1: Line 1:
-**set_pipeline_parameter_from_expression** +====== Set Pipeline Parameter From Expression ====== 
-/parameter_name=t_mass +This command can be used to set the value of a specified parameter by defining it with an expression. This allows the value of a parameter to be set to anything from an explicit value to an expression containing other signals
-/expression=metric::processed::height * 4.6 +
-/as_integer=true +
-**;** +
-the pipeline parameter contains the value of the expression.+
  
-getting the syntax correct can be challenging because there can be a conflict between the & as a concatenation parameter in a pipeline parameter and the as a boolean "and" operator.+====Pipeline Command==== 
 +The command can be found in the Pipeline Workshop within the Pipeline Control folder as so: 
 +<code> 
 +Set_Pipeline_Parameter_From_Expression 
 +/PARAMETER_NAME= 
 +/EXPRESSION= 
 +! /AS_INTEGER=TRUE 
 +
 +</code>
  
-for many pipeline commands visual3d recognizes the conflict and handles the situations in a context specific way.+====Command Parameters==== 
 +The following table shows the command parameters that can be used to define the command and their descriptions: 
 +|**Parameter**   |**Description**| 
 +|**Parameter Name**|The name of the Pipeline ParameterThe parameter is referred to by other commands using two colons (::) in front of the parameter name| 
 +|**Expression**|The expression used to define the parameter value| 
 +|**As Integer**|True or False: Express the resulting parameter value as an integer|
  
-visual3d cannot make that distinction and "bad" things happen.+For more information on how expressions can be used and defined see [[visual3d:documentation:pipeline:expressions:expressions_overview|Expressions Overview]].
  
-consider the following which uses string comparisons and a pipeline parameter in the expression:+====Syntax Notes====
  
-**set_pipeline_parameter_from_expression** +<code> 
-/parameter_namemval +Set_Pipeline_Parameter_From_Expression 
-/expression=(&::tag_names& == utility) * 4.6 +/PARAMETER_NAME=t_Mass 
-/as_integer=false +/EXPRESSION=METRIC::PROCESSED::HEIGHT * 4.6 
-**;** +/AS_INTEGER=TRUE 
-the goal was to set mval to 4.6 when the pipeline parameter tag_names was equal to the string "utility";+
 +</code> 
 +The pipeline parameter contains the value of the expression.
  
-one solution is to separate the pipeline parameter from the expression.+Getting the syntax correct can be challenging because there can be a conflict between the & as a concatenation parameter in a pipeline parameter and the & as a boolean "and" operator.
  
-**set_pipeline_parameter** +For many pipeline commands Visual3D recognizes the conflict and handles the situations in a context specific way.
-/parameter_name=temp +
-/parameter_value=(&::tag_names& == utility)*4.+
-**;** +
-\\+
  
 +Visual3D cannot make that distinction and "bad" things happen.
  
-**set_pipeline_parameter_from_expression** +Consider the following which uses string comparisons and a pipeline parameter in the expression: 
-/parameter_name=t_mass + 
-/expression=::temp +<code> 
-/as_integer=false +Set_Pipeline_Parameter_From_Expression 
-**;**+/PARAMETER_NAMEMVAL 
 +/EXPRESSION=(&::TAG_NAMES& == Utility) * 4.6 
 +/AS_INTEGER=FALSE 
 +; 
 +</code> 
 + 
 +The goal was to set MVAL to 4.6 when the pipeline parameter TAG_NAMES was equal to the string "Utility"; 
 + 
 +One solution is to separate the pipeline parameter from the expression. 
 + 
 +<code> 
 +Set_Pipeline_Parameter 
 +/PARAMETER_NAME=TEMP 
 +/PARAMETER_VALUE=(&::TAG_NAMES& == Utility)*4.6 
 +
 +</code>
 \\ \\
-another solution, which is even trickier in terms of syntax is: 
  
-**set_pipeline_parameter_from_expression** +<code> 
-/parameter_name=scott +Set_Pipeline_Parameter_From_Expression 
-/expression=("&::tag_names&"==" utility") +/PARAMETER_NAME=t_Mass 
-/as_integer=true +/EXPRESSION=::TEMP 
-**;** +/AS_INTEGER=FALSE 
-this forces visual3d to recognize the strings as strings and the & is treated correctly.+
 +</code>
  
 \\ \\
 +Another solution, which is even trickier in terms of syntax is:
  
 +<code>
 +Set_Pipeline_Parameter_From_Expression
 +/PARAMETER_NAME=SCOTT
 +/EXPRESSION=("&::TAG_NAMES&"==" Utility")
 +! /AS_INTEGER=TRUE
 +;
 +</code>
  
-==== get global metrics ====+This forces Visual3D to recognize the strings as strings and the & is treated correctly.
  
-global metrics can be set to a pipeline parameter by setting "global" in front of the metric name. more information about expressions can be found [[visual3d:documentation:pipeline:expressions:overview|here]].+\\
  
-**set_pipeline_parameter_from_expression** 
-/parameter_name=katie 
-/expression=global::metric::processed::mass 
-/as_integer=false 
-**;** 
  
 +====Example: Get global metrics ====
 +Global metrics can be set to a pipeline parameter by setting "GLOBAL" in front of the metric name. More information about expressions can be found [[Visual3D:Documentation:Pipeline:Expressions:Expressions_Overview|here]].
  
 +<code>
 +Set_Pipeline_Parameter_From_Expression
 +/PARAMETER_NAME=KATIE
 +/EXPRESSION=GLOBAL::METRIC::PROCESSED::MASS
 +/AS_INTEGER=FALSE
 +;
 +</code>
visual3d/documentation/pipeline/pipeline_commands/set_pipeline_parameter_from_expression.1718801553.txt.gz · Last modified: by sgranger