Production Applications: Piping
This section contains information about the Piping API functions. The functions in this section allow a Creo TOOLKIT application to create, read, and write pipe linestock information. These APIs also support analysis of pipeline connectivity as built with the Creo Parametric module Piping.
Piping Terminology
Creo TOOLKIT supports Piping. Piping uses specific terminology. This section defines this terminology.
A pipeline is set of interconnecting pipes and fitments. A pipeline consists of an extension which terminates at open ends (that is, ends with no further pipeline items are attached), non-open ends (that is, ends with equipment such as nozzles or other pipelines), or junctions. A pipeline also contains extensions that branch from extensions which branch from it, then others which branch from those, and so on.
A pipeline extension is a non-branching sequence of pipeline items.
A pipeline feature is a feature which names the pipeline to show its grouping. All other features in the pipeline refer to this feature. A pipeline feature does not contain any geometry of its own.
At a branch (or junction), pipes are grouped into extensions such that the extension which continues across the branch has a continuous direction of flow, and, if that criterion leaves a choice, has the smallest change of direction possible for that branch. Other pipes which join that branch then form the end points of other extensions.
A member of an extension is a terminator, a series, or a junction.
A terminator is the open or non-open ends of the pipeline.
A series is a non-branching sequence of pipeline objects.
A junction is an assembly component or a datum point which represents a part which joins three or more pipe segments.
A stubin is a datum point which joints three or more series.
A segment is a section of pipe, either straight or arced. If arced, the segment is manufactured by taking a straight section of tube and bending it.
A fitting is a component that connects two pipe segments, for example, to form a corner where space does not allow a bent pipe segment, or to represent an item such as a valve
A pipeline object is a segment, a fitting, or a stubin.
A pipeline network is a data structure which contains references to pipeline objects. The objects are structured to show their connectivity and sequence in relation to the flow.
Linestock Management Functions
This section presents functions for management of linestock.
Linestocks
Functions introduced:
  • ProAssemblyLnstksCollect()
  • ProPipelineLnstkGet()
  • ProPipelineLnstkSet()
  • ProLnstkCreate()
  •         typedef struct pro_lnstk
            {
              ProName            name;
              ProAssembly        owner;
            } ProLnstk;
    The function ProAssemblyLnstksCollect() finds all the linestocks defined for a specified assembly.
    The functions ProPipelineLnstkGet() and ProPipelineLnstkSet() get and set the default linestock for a specified pipeline feature.
    The function ProLnstkCreate() creates a new linestock in the specified assembly.
    Linestock Parameters
    Functions introduced:
    The parameters of a linestock differ from regular Creo Parametric parameters in that they may be organized hierarchically. The data structure ProLnstkParam contains the description of a linestock parameter and its member parameters, if any. Its declaration follows, along with those of its member types.
            typedef enum 
            {
              PROLNSTKPRM_SINGLE,
              PROLNSTKPRM_MULTIPLE
            } ProLnstkParamType;
            typedef struct _pro_lnstk_param_memb_
            {
              ProName            name;
              ProParamvalue      value;
            } ProLnstkParamMemb;
            typedef struct _pro_lnstk_param_
            {
              ProName            name;
              ProLnstkParamType  param_type;
              union {
                       ProParamvalue         value;
                       ProLnstkParamMemb    *members;
                    } lnstk_param_value;
            } ProLnstkParam;
    The function ProLnstkParametersCollect() finds all the parameters for a specified linestock.
    The function ProLnstkParametersSet() sets the parameters on a specified linestock to a specific list.
    The function ProLnstkParameterAdd() adds a new parameter to the list of parameters on a specified linestock.
    The function ProLnstkParameterDelete() deletes a named parameter from a linestock.
    The linestock parameters can be set using the following enumerated types:
    •  ProLnstkPipeSection—Specifies the type of the pipe section as Hollow or Solid.
    •  ProLnstkPipeShape—Specifies the type of the pipe shape as Flexible or Straight.
    •  ProLnstkPipeCrnrType—Specifies the type of the pipe corner as Bend, Fitting, or Miter Cut. Corners are not set for flexible pipes.
    •  ProLnstkPipeXSection—Specifies the cross section of the pipe as Circular or Rectangular.
    For round pipes the value of ProLnstkPipeXSection is set to PROLNSTKPIPEXSECT_CIRCULAR. Use the function ProLnstkParametersCollect() to access the values of the following pipe section parameters:
    •  OD—Outer diameter of the pipe.
    •  WALL_THICKNESS—Wall thickness of the pipe.
    For rectangular pipes the value of ProLnstkPipeXSection is set to PROLNSTKPIPEXSECT_RECTANGULAR. Use the function ProLnstkParametersCollect() to access the values of the following pipe section parameters:
    •  RECTANGULAR_HEIGHT—Height of the rectangular pipe.
    •  RECTANGULAR_WIDTH—Width of the rectangular pipe
    •  RECTANGULAR_ANGLE—Rotate angle of the pipe solid part around its reference entity. The angle is relevant only in square pipes.
    •  WALL_THICKNESS—Wall thickness of the pipe.
    Pipeline Features
    The functions in this section are used to create and work with pipeline features. These functions also allow a Creo TOOLKIT application to create, read, and write line stock information.
    Functions introduced:
    The function ProPipelineSpecDrivenCreate() creates line stock and pipeline features according to the specification parameters defined in the structure ProPipingSpecParams. The pipeline feature is created using the newly created line stock feature. The name of the line stock feature is generated based on the specification parameters. The name of the pipeline feature is generated based on the specification parameter and the configuration option pipeline_label_format.
    The input arguments are:
    •  model—Specifies the model where the pipeline feature must be created. The model must be Specfication-Driven, or the configuration option piping_design_method must be set to spec_driven.
    The configuration option piping_design_method enables you to set the design mode for the piping project. To activate the Spec-Driven design mode set the value of the configuration option to spec_driven. In this mode, the piping systems are created using the specified specifications. For Non Spec-Driven mode, set the value to non_spec_driven. In this mode, the piping systems are created manually without using project-specific data. To work in the User-Driven mode, set the value to user_driven. This mode enables you to switch between Spec-Driven and Non Spec-Driven piping design modes. You can convert existing assemblies to required design mode at any time in the design process.
    •  spec_params—Specifies the specification parameters. These parameters are defined in the structure ProPipingSpecParams. User must set the parameter values in the structure based on the values defined in the auto-selection file. Refer to the Creo Parametric Piping Help for more information on the auto-selection files.
    •  Mnemonic—Specifies the fluid or piping system. If the value is specified as NULL, then the default mnemonic defined in the Specification Directory file is used. The path and name of the Specification Directory file are set in the configuration option piping_spec_dir_file. If you pass an empty string, then no mnemonic value is assigned to the pipeline feature.
    •  number—Specifies a number which uniquely identifies the pipeline. If the value is specified as NULL or an empty string, then no number is assigned to the pipeline feature.
    •  insulation—Specifics the insulation for the pipeline. If the value is specified as NULL, then the default insulation defined in the Specification Directory file is used. The path and name of the Specification Directory file are set in the configuration option piping_spec_dir_file. If you pass an empty string, then the pipeline feature is created without insulation.
    •  CreateSubAsm—Specifies if the pipeline must be created as a new subassembly. The pipeline subassembly is created using the template model defined in the configuration option pipeline_start_assembly_name.
    •  SubAsmName—Specifies the name of the pipeline subassembly. If you pass the value of the argument as NULL or an empty string, then the name of the pipeline subassembly is generated based on the configuration option pipeline_assembly_name_format.
    •  csys_reference—Specifies a coordinate system for the placement of the pipeline subassembly. If the value is specified as NULL, then the coordinate system of the model is used to place the subassembly.
    The function ProPipelineCreateFromXML() creates line stock and pipeline features according to the schematic information defined in the XML file for the specified pipeline label. The name of the line stock feature is generated based on the specification parameters. The name of the pipeline feature is generated based on the specification parameter and the configuration option pipeline_label_format.
    The input arguments are:
    •  model—Specifies the model where the pipeline feature must be created. The model must be Specfication-Driven, or the configuration option piping_design_method must be set to spec_driven. The model must be enabled for schematic-driven modeling. The configuration option piping_schematic_driven must be set to yes.
    The configuration option piping_schematic_driven enables or disables the schematic-driven modeling mode for a piping project. The valid values are yes and no.
    •  xml_file—Specifies the path to the XML file which contains schematic information for pipelines.
    •  pipeline_label—Specifies the pipeline label for the XML file. The properties SPEC, SIZE, SCHEDULE, MNEMONIC, NUMBER, and INSULATION associated with a pipeline label are updated from the XML file. The property GRADE, that is, the material code is updated based on the other specification parameters. The property CATEGORY has its value set as PIPE.
    •  insulation—Specifics if the pipeline must be created with insulation. If the value is specified as TRUE, then the pipeline is created with insulation based on the parameter INSULATION defined in the XML file.
    •  CreateSubAsm—Specifies if the pipeline must be created as a new subassembly. The pipeline subassembly is created using the template model defined in the configuration option pipeline_start_assembly_name.
    •  SubAsmName—Specifies the name of the pipeline subassembly. If you pass the value of the argument as NULL or an empty string, then the name of the pipeline subassembly is generated based on the configuration option pipeline_assembly_name_format.
    •  csys_reference—Specifies a coordinate system for the placement of the pipeline subassembly. If the value is specified as NULL, then the coordinate system of the model is used to place the subassembly.
    The function ProPipelineCreate() creates a Non Specification-Driven pipeline feature. The pipeline is created under the specified model. The input arguments are:
    •  model—Specifies the model where the pipeline feature must be created. The model must be Non Specfication-Driven.
    •  lnstk—Specifies the line stock feature. The line stock feature must have the specified model as its parent.
    •  pipeline_name—Specifies the name of the pipeline feature.
    The function ProPipelineParametersCollect() retrieves all the parameters of the specified pipeline as a ProArray. Use the function ProArrayFree to release the memory assigned to the ProArray of parameters.
    Use the function ProPipelineParametersSet() to set the parameters in the specified pipeline.
    The function ProPipelineParameterAdd() adds the parameter in the specified pipeline.
    The function ProPipelineParameterDelete() deletes the parameter in the specified pipeline.
    In this section, we have explained only the configuration options which are required to work with the piping APIs. Refer to the Creo Parametric Piping Help for the complete list of piping configuration options and their detailed descriptions.
    Pipeline Connectivity Analysis
    The functions in the section support analysis of pipeline connectivity.
    Networks
    Functions introduced:
    A pipeline is a collection of Creo Parametric piping features and components that are connected together. A pipeline feature is a single feature that unites all the features and components in a pipeline. All the features and components that belong to one pipeline reference the pipeline feature.
    A network is a temporary data structure which is the result of analyzing the connectivity and topology of the features and components in a pipeline. The functions in this section allow a Creo TOOLKIT application to create and analyze the network for a pipeline, which would be the first step in, for example, an analysis of the fluid flow down the pipeline.
    The network is a hierarchical data structure whose branches describe the various logical subdivisions into which the features and components of a pipeline divide themselves according to their connectivity.
    A network is described by the opaque pointer ProPnetwork. The function ProPipelineNetworkEval() analyzes the features and components that belong to a pipeline (specified by its pipeline feature, belongs to the top model) and builds a network data structure.
    The function ProPipelineNetworkEvaluate() analyzes the features and components that belong to a pipeline (specified by its pipeline feature and path) in the top level assembly or its sub assemblies and builds a network data structure. The input arguments are:
    •  p_comp_path —Specify the path from the top model to the pipeline's model by usingProAsmcomppath.
    •  pipeline —The feature handle to the pipeline feature.
    The output argument network is a handle to the network structure. It is an opaque pointer to a structure that is accessed by functions starting with ProPnetwork.
    After the structure has been analyzed it should be freed using ProPnetworkFree().
    The functions ProPnetworkLabelGet(), ProPnetworkSizeGet(), and ProPnetworkSpecGet() get information about the pipeline described by a specified network.
    Extensions
    Functions introduced
    A network contains a list of extensions. An extension is a non branching sequence of connected pipeline items. At a branch in a pipeline one extension is continuous across the branch and other extensions terminate at the branch. To decide which extension is continuous across the branch, the analysis performed by ProPipelineNetworkEval() uses the following rules:
    •  The extension must have a continuous direction of flow across the branch.
    •  Of all such possible extensions, the one chosen is the one that gives the smallest change of direction across the branch.
    An extension is represented by the opaque pointer ProPextension. The function ProPnetworkExtensionVisit() visits all the extensions in a network.
    The function ProPextensionFlowGet() tells you the flow direction in relation to the sequence of members in the extension.
    Members
    Functions introduced:
    An extension is conceptually divided into objects called members, described by the opaque object ProPmember. The members in an extension divide it at the pipeline branches which the extension crosses.
    There are three types of member:
    •  Terminator—The end of a pipeline, where it either opens or connects to an item outside the pipeline, described by the opaque object ProPterminator.
    •  Junction—The item that describes how the pipeline branches, described by the opaque object ProPjunction.
    •  Series—A non branching sequence of pipeline objects, described by the opaque object ProPseries.
    The function ProPextensionMemberVisit() visits all the members in an extension, and the function ProPmemberTypeGet() reports which of the three types the member represents. Each of three types of member is in turn composed of one or more objects.
    The following sections describe the analysis of the three types of members.
    Terminators
    Functions introduced:
    The function ProPmemberTerminatorGet() outputs the Pterminator object, which represents the terminator in the specified member.
    The function ProPterminatorTypeGet() tells you whether a terminator is an input or an output.
    Junctions
    Functions introduced:
    The function ProPmemberJunctionGet() outputs the Pjunction object which represents the junction in the specified member.
    Series
    Functions introduced:
    The function ProPmemberSeriesGet() outputs the Pseries object which represents the series in the specified member.
    The function ProPseriesIdGet() yields the integer id of the specified series.
    Objects
    Functions introduced:
    A Piping Object describes a single item in a pipeline and is represented by the opaque pointer Pobject.
    The functions ProPterminatorObjectGet() and ProPjunctionObjectGet() output the single object used to represent a terminator or a junction. The function ProPseriesObjectVisit() visits all the objects that represent the contents of a series.
    The function ProPobjectTypeGet() yields one of the following types:
    •  Segment—A single pipe segment, either bent or straight. Can only belong to a series.
    •  Fitting—An assembly component that connects two or more pipeline segments. Can belong to a Series (if it connects two segments) or a Junction (if it connects more than two segments).
    •  Stubin—A datum point that defines the location where two or more pipeline segments connect directly without a fitting. Can only belong to a Junction.
    •  Selection—An object that contains a ProSelection describing the item a pipeline terminator connects to. Can only belong to a Terminator.
    The function ProSelectionPipelineGet() outputs the pipeline feature to which the specified pipeline selection belongs.
    The function ProPobjectSegmentGet() outputs the Segment contained by an Object of the appropriate type. The Segment is described in the next section.
    The function ProPobjectFittingGet() outputs the fitting contained by an object of the appropriate type. The fitting is represented by the opaque object ProPfitting. The assembly component that represents the fitting can be found using the function ProPfittingAsmcompGet().
    The function ProPobjectStubinGet() outputs the stubin contained by an object of the appropriate type. The stubin is represented by the opaque pointer ProPstubin. The function ProPstubinPointGet() yields the 3-D location of the stubin.
    The function ProPobjectSelectionGet() outputs the selection contained by an object of type terminator. The function ProPselectionSelectionGet() provides the ProSelection object that the selection contains and identifies the item outside the pipeline to which the terminator connects.
    Segments
    Functions introduced:
    A segment is represented by the opaque pointer ProPsegment.
    The function ProPsegmentTypeGet() tells you whether the segment is straight or bent.
    The function ProPsegmentLinestockGet() outputs which linestock was used for this segment. Note that because the pipeline may contain fittings which cause a change in diameter, some segments in the pipeline may yield a different linestock from that provided by ProPipelineLnstkGet() for the pipeline itself.
    The function ProPsegmentLengthGet() outputs the physical length of the segment.
    The function ProPsegmentCurvesGet() outputs an array of ProCurve objects that describes the geometry of the centerline of the segment. The curves are always listed in the direction of flow.
    Connecting Pipeline Segments
    You can connect disconnected segments of the same pipeline or entry ports using the pipe connect feature.
    The element tree for the pipe connect feature is documented in the header file ProPipConnect.h and is shown in the following figure:
    Element Tree for Pipe Connect Feature
    Image
    The following table describes the elements in the element tree for the pipe connect feature:
    Element ID
    Data Type
    Description
    PRO_E_FEATURE_TYPE
    PRO_VALUE_TYPE_INT
    Mandatory element. Specifies the type of the feature. The valid value for this element is PRO_FEAT_PIPE_JOIN.
    PRO_E_STD_PIPE_LINE_ENV
    PRO_ELEM_TYPE_COMPOUND
    This compound element defines the pipe options.
    PRO_E_STD_PIPE_LINE_ID
    PRO_ELEM_TYPE_INT
    This element is mandatory, except the pipe route environment.
    Specifies the ID of the pipeline.
    PRO_E_STD_PIPE_LINE_LNSTK
    PRO_ELEM_TYPE_INT
    Optional element. Specifies the line stock. The default line stock is taken from the related pipeline.
    PRO_E_STD_PIPE_LINE_CORNER_TYPE
    PRO_ELEM_TYPE_OPTION
    Optional element. Specifies the type of corner for the connect feature. The segments in the connect feature are joined using corners. The types of corner are set in the line stock. The default type of corner is taken from the related pipeline.
    The valid values for types of corner are:
    •  PRO_PIPE_CORNER_TYPE_FITTING—Creates sharp corners. You can later add corner fittings. Fitted corners create breaks in a pipeline.
    •  PRO_PIPE_CORNER_TYPE_MITER—Creates a corner by adding a miter cut.
    •  PRO_PIPE_CORNER_TYPE_BEND—Creates each corner by bending the pipe.
    PRO_E_STD_PIPE_LINE_BEND_RAD
    PRO_ELEM_TYPE_DOUBLE
    Optional element. This element is relevant when the corner type is set to PRO_PIPE_CORNER_TYPE_BEND. Specifies the radius of the bend. The default bend radius is taken from the related pipeline.
    For Specification-Driven pipelines, the value of bend radius is defined in the line stock, which is related to the pipeline.
    PRO_E_STD_PIPE_LINE_MITER_NUM
    PRO_ELEM_TYPE_INT
    Optional element. This element is relevant when the corner type is set to PRO_PIPE_CORNER_TYPE_MITER. Specifies the number of miter cuts. The default number of cuts is taken from the related pipeline.
    For Specification-Driven pipelines, the number of miter cuts is defined in the line stock, which is related to the pipeline.
    PRO_E_STD_PIPE_LINE_MITER_LEN
    PRO_ELEM_TYPE_DOUBLE
    Optional element. This element is relevant when the corner type is set to PRO_PIPE_CORNER_TYPE_MITER. Specifies the length of the miter cut. The default length is taken from the related pipeline.
    For Specification-Driven pipelines, the length of the miter cut is defined in the line stock, which is related to the pipeline.
    PRO_E_PIPE_CONNECT_FROM_MAIN_REF
    PRO_ELEM_TYPE_SELECT
    Mandatory element. Specifies the first end of the connect feature.
    PRO_E_PIPE_CONNECT_TO_MAIN_REF
    PRO_ELEM_TYPE_SELECT
    Mandatory element. Specifies the second end of the connect feature.
    PRO_E_PIPE_CONNECT_DIMS_SCHEME
    PRO_ELEM_TYPE_OPTION
    Optional element. Specifies the dimensioning scheme to be used to connect the two ends. The valid values are:
    •  PRO_PIPE_DIM_SCHEME_L1_L2—Sets an offset from both ends of the connect. This is the default option.
    •  PRO_PIPE_DIM_SCHEME_L1_A1—Sets an offset from the first end of the connect and the angle between the first segment and middle segment of the connect.
    •  PRO_PIPE_DIM_SCHEME_L1_A2—Sets an offset from the first selected end of the connect, and the angle between the middle segment and the second end.
    •  PRO_PIPE_DIM_SCHEME_L2_A1—Sets an offset from the second selected end of the connect, and the angle between the first segment and middle segment of the connect.
    •  PRO_PIPE_DIM_SCHEME_L2_A2—Sets an offset from the second selected end of the connect, and the angle between the middle segment and the second end.
    •  PRO_PIPE_DIM_SCHEME_A1_A2—Sets the angles between the end segments and the middle segment of the connect.
    Note
    If length is missing, then its value is considered as 0. If angle is missing, then the default dimensioning scheme PRO_PIPE_DIM_SCHEME_L1_L2 is used. Here again, if length is missing, then its value is considered as 0.
    Refer to the Creo Parametric Piping help for more information on the segments and angles created by the connect feature.
    PRO_E_PIPE_ROUTE_ENDS
    PRO_ELEM_TYPE_COMPOUND
    This compound element defines the offset and angle values for the ends in the connect feature.
    The two main elements of PRO_E_PIPE_ROUTE_ENDS are:
    •  PRO_E_PIPE_ROUTE_END_FIRST—This compound element specifies the values for the first end of the connect feature.
    •  PRO_E_PIPE_ROUTE_END_SECOND—This compound element specifies the values for the second end of the connect feature.
    The following elements are common to the both the compound elements:
    Element ID
    Data Type
    Description
    PRO_E_PIPE_ROUTE_END_OPT
    PRO_ELEM_TYPE_OPTION
    Optional element. Specifies the type of offset. The valid values are:
    •  PRO_PIPE_OFFSET_REFERENCE—Specifies that the offset is defined from an reference object. The reference object can be a datum plane or coordinate system, which is perpendicular to the end axis or coordinate axis.
    •  PRO_PIPE_OFFSET_END—Specifies that the offset is defined from the selected end.
    PRO_E_PIPE_ROUTE_END_LENGTH
    PRO_ELEM_TYPE_DOUBLE
    Optional element. Specifies the value for offset lengths. Depending on the dimensioning scheme, specify the value length_1 for L1 and length_2 for L2. The default value is 0.0.
    PRO_E_PIPE_ROUTE_END_REF
    PRO_ELEM_TYPE_SELECT
    This element is mandatory if the type of offset is set to PRO_PIPE_OFFSET_REFERENCE. Specifies the reference object.
    PRO_E_PIPE_CONNECT_END_ANGLE
    PRO_ELEM_TYPE_DOUBLE
    Optional element. Specifies the value for the segment angles. Depending on the dimensioning scheme, specify angle_1 for A1 and angle_2 for A2. The default value is 0.0.
    Note
    If the angle is missing, then the dimensioning scheme PRO_E_PIPE_CONNECT_DIMS_SCHEME is changed to PRO_PIPE_DIM_SCHEME_L1_L2. The default values of L1 and L2 are 0.0.