Piping > Setting Up Piping Library > Non Spec-Driven Parameters > Writing Relations
  
Writing Relations
You can access piping line stock parameters, pipeline parameters, and pipeline bend parameters through writing relations. The syntax for the relation is the same as that for part modeling.
The feature name of the ID must refer to the line stock, pipeline feature, or pipe bend for the pipe, not to the pipe routing feature. You cannot set their values through the relations you create, but you can control dimension values.
The following file is an example of how to write a relation to control the width of a channel in a pipeline. The following relations control the width of the channel, d7:0, to keep it equal to the outer diameter of the pipe, as specified in the pipeline feature’s line stock parameters (assuming that the only two fluids in use are oil and H2O and that each gets assigned a single line stock):
IF fluid:fid_LINE1 = ‘oil’
d7:0 = OD:fid_OIL_STK
ELSE
d7:0 = OD:fid_H2O_STK
ENDIF
If this pipeline (LINE1) has oil as the value for the fluid parameter, make the channel width equal to the outer diameter in the line stock OIL_STK. Otherwise, the channel width should be equal to the outer diameter of the line stock H2O_STK.
Because the outer diameter of the pipeline, OD, is a parameter of a line stock (in this case OIL_STK or H2O_STK), the system uses the feature ID of the appropriate line stock in the relation.
Also, because this is an assembly relation, not a part relation referencing an assembly, a component ID is not required in the relation. Keep in mind that the system determines a pipeline’s physical (solid) shape based on the line stock from which it actually derives the pipe.
Example: Using Relations in Piping
You can write a relation to control the width of the channel, d7:0, to keep it equal to the outer diameter of the pipe, which is specified in the line stock parameters of the pipe feature.