Production Applications: Cabling
This section describes the Creo TOOLKIT cabling functions.
Cabling
This section describes the functions in Creo TOOLKIT that access the contents of a cabling harness created using the cabling module in Creo Parametric. The explanations in this section assume a knowledge of cabling and the fundamental concepts of Creo TOOLKIT, especially assemblies.
Be careful with the terminology of cabling. You can route three kinds of objects to make electrical connections within a harness: wires, cables, and bundles. The generic word for all three is cable. Unless otherwise specified, the explanations in the following sections use the word cable, in its generic sense, to include wires, cables, and bundles.
Creo TOOLKIT uses the object type ProCable to refer to any type of cable object. The data object has the same structure as ProModelitem.
Typedef struct pro_model_item {
     ProMdl owner;
     int id;
     protype type;                 
)ProCable;
Creating a Harness
Function Introduced:
ProCable operates on a Creo Parametric assembly. Cables can belong to one or more harness. A harness is a special Creo Parametric part designed to contain cables.
A harness cannot be retrieved into Creo Parametric Part mode. It appears in the cabling assembly as an assembly component. A harness is identified by the Creo Parametric object handle ProHarness.
The function ProHarnessCreate() creates a new harness in the specified assembly.
Finding a Harness
Function Introduced:
The function ProAssemblyHarnessesCollect() returns an array of handles to any harness that is part of a specified assembly and its sub-assemblies.
The function ProAssemblyHarnessesTopCollect() returns an array of handles to the harnesses present in the specified top level assembly.
Use the function ProAsmcompIsHarness() to identify if the specified component is a harness part. This function returns the value TRUE, if the component is a harness. The function ProCablingIsHarness() identifies if the specified model is a harness part.
Use the function ProHarnessSubharnessesCollect() to collect all the sub harnesses in the specified input harness part.
Finding the Cables in a Harness
Functions Introduced:
The function ProHarnessCablesCollect() provides an array of names of cables that exist in the specified harness. The output of the function includes cables that have not yet been routed.
Each cable can be created in, and routed though, several harnesses. The function ProCableHarnessesGet() provides an array of the handles to the harnesses below the current assembly that contain a cable with the specified name.
Use function ProInputFileRead() with argument PRO_WIRELIST_TYPE to read files in Mentor Graphics LCABLE format. This function does not create wires, but provides parameters from a wire list for use when creating in a harness assembly a wire with the same name as that in the LCABLE file.
Harness Parameters
Functions Introduced:
Use the function ProCablelocationAttachToHarnessComponentGet() to get the component on which the attach to harness location is dependent.
Use the function ProCablelocationIsAttachToHarness() to identify if the specified location is a cabling attach to harness location.
Importing Neutral Wire List Files
The PTC neutral wire format contains logical information for cabling. It contains information about the reference designator, pin-to-pin connection, and parameter values of connectors, pins, spools, wires, and cables.
Functions Introduced:
The function ProCablingNeutralwirelistImport() allows you to import and load the PTC neutral wire list file (.nwf) in the current session. Specify the name of the file along with its extension and full path as the input argument filename.
Managing Spools
Functions Introduced:
Function ProAssemblySpoolsCollect() returns a list of all spools defined in the specified assembly.
Use function ProSpoolCreate() to create a new spool of a given cable and sheath type in the specified assembly.
Use function ProInputFileRead() with argument PRO_SPOOL_FILE to create new spools or update existing ones. Function ProOutputFileMdlnameWrite() with the same argument to export a spool file.
Spool Parameters
Functions Introduced:
Function ProSpoolParameterGet() retrieves a single parameter for the specified spool. This function supports only single-valued parameters. If you specify a multivalued parameter, the function returns PRO_TK_E_NOT_FOUND.
Function ProSpoolParameterCollect() retrieves all parameters of the specified spool, both single- and multi-valued parameters.
Use ProSpoolParameterDelete() to remove a single parameter from the specified spool. This function deletes both single- and multi-valued parameters.
Function ProSpoolParametersSet() sets all parameters of the specified spool, both single- and multi-valued parameters. This function overwrites existing parameter values with values in the input parameter array.
Function ProSpoolsFromLogicalGet() returns a list of spool names in the specified assembly for which data has been imported from a logical reference but which have not yet been created. Use function ProSpoolsFromLogicalCreate() to create instances of spools for which logical data exists. Refer to the Creo Parametric Cabling Help and Creo Parametric Harness Help for more information on logical references.
Use the function ProSpoolCablesLengthGet() to get the total length of all the cables present in the specified input harness, using the specified spool.
Use the function ProSubharnessCablesCollect() to retrieve an array of all the cables present in the specified sub harness.
Finding Harness Connectors
Functions Introduced:
Each connector in a cabling assembly is a Creo Parametric part that is a component of that assembly. A connector can be at any level in the assembly hierarchy. Each connector is identified by its assembly component path (ProAsmcomppath).
The function ProAssemblyConnectorGet() provides an array of member identifier tables identifying the connectors in the specified assembly. The function allocates the memory for these tables.
Function ProConnectorsFromLogicalGet() returns a list of connector names in the specified assembly for which data has been imported from a logical reference but which have not yet been created. Refer to the Creo Parametric Cabling Help and Creo Parametric Harness Help for more information on logical references.
Use the function ProAsmcompIsConnector() to identify if the specified component is a cabling connector. This function returns the value TRUE, if the component is a cabling connector.
Connectors Parameters
Functions Introduced:
Each connector contains a set of entry ports to which cables can be connected. Each entry port is modeled by a coordinate system datum that belongs to the part that models the connector. The function ProConnectorEntryPortsGet() returns a ProArray of datum coordinate systems representing the entry ports in the specified connector. The connector is identified by its component path (its memb_id_tab).
The function ProConnectorParamsCollect() provides an array of the user parameters for the connector. However, this array contains only single-valued parameters that refer to the connector itself, not the parameters that describe the entry ports.
To access parameters on the connector entry ports, you must call the function ProOutputFileMdlnameWrite() with the option PRO_CONNECTOR_PARAMS_FILE. This writes a text file to disk, which is the same format as the file you edit when using the ProCable command Connector, Modify Parameters, Mod Param.
The following example shows a sample connector parameters file. Refer to the Creo Parametric Cabling Help on the parameters.
The function ProConnectorRefModelNameGet() retrieves the reference model name of the specified cable connector. The function returns the output argument p_ref_model_name as a wchar_t* string.
Use the function ProCableCurvesGet() to retrieve the trajectory entities for the specified feature. The input arguments are:
•  cbl_feat—Specify the cable for which the ProCurves is returned using the object ProCable.
•  inc_bundle—Returns the ProCurve function for the bundles through which the cable is passed using the ProBoolean object.
The output argument p_curves is a ProArray of the curves.
Connector Parameters File
! Enter or modify parameters for the connector. You may use the help
! functionality of Pro/TABLE to enter pre-defined parameters.
! Ref DescrREF_DES MOTOR
! Conn ModelMODEL_NAME      MOTOR
! Num Of PinsNUM_OF_PINS     2
! TypeTYPE    CONNECTOR
! Entry Port
!                                   TYPE    INT_LENGTH
ENTRY_PORT      ENTRY1              ROUND   0.2     
ENTRY_PORT      ENTRY2              ROUND   0.2     !
Signal!
               PIN_ID  SIGNAL_NAME     SIGNAL_VALUE    ENTRY_PORT
SIGNAL          1                                       ENTRY1
SIGNAL          2
! Pin
!               PIN_ID  CABLE_NAME      COND_ID 
PIN_ASSIGN      2       WIRE_1
PIN_ASSIGN      1       WIRE_2
! Enter or modify parameters for the connector. You may use the help
! functionality of Pro/TABLE to enter pre-defined parameters.
     ! Ref Descr     REF_DES MOTOR
     ! Conn Model     MODEL_NAME      MOTOR
     ! Num Of Pins     NUM_OF_PINS     2
     ! Type     TYPE    CONNECTOR
     ! Entry Port     
!                       TYPE    INT_LENGTH
ENTRY_PORT      ENTRY1  ROUND   0.2     
ENTRY_PORT      ENTRY2  ROUND   0.2     
! Signal     
!               PIN_ID  SIGNAL_NAME     SIGNAL_VALUE    ENTRY_PORT
SIGNAL          1                                       ENTRY1
SIGNAL          2     
! Pin
!               PIN_ID  CABLE_NAME      COND_ID 
PIN_ASSIGN      2       WIRE_1
PIN_ASSIGN      1       WIRE_2
Note that this file is not free-format. Each parameter name and value is followed by a tab character, and each empty value is represented by a tab character. Therefore, the line in the example that assigns the first parameter, SIGNAL, contains three tab characters between the value of the PIN_ID and the value of ENTRY_PORT: the first tab belongs to the PIN_ID value, and next two tabs provide null values for SIGNAL_NAME and SIGNAL_VALUE.
The function ProInputFileRead() imports a file in this format, so you can use it in conjunction with ProOutputFileMdlnameWrite() to edit the parameters on connectors and their entry ports. To identify the connector, both functions use the following arguments:
•  arg1—Represents the memb_id_tab
•  arg2—Represents the memb_num
The function ProConnectorDesignate() designates a component in the assembly as a cabling connector. It takes as input the component path that identifies the part in the cabling assembly, and an optional name that will be the reference descriptor (REF_DES) of the connector.
When a new connector has been designated, it has only the two parameters REF_DES and MODEL_NAME. The MODEL_NAME is set to be the name of the part designated, and the REF_DES is set to the value provided as input to the function ProConnectorDesignate(), if any, or to the MODEL_NAME otherwise. After you designate a connector, you must call ProOutputFileMdlnameWrite() and ProInputFileRead() to set up the necessary parameters.
The function ProConnectorWithAllParamsDesignate() designates a component in the assembly as a cabling connector using all the logical parameters. The input arguments are:
•  p_connector—Specifies the component path that identifies the part in the cabling assembly.
•  name—Specifies the reference descriptor (REF_DES) of the connector. The argument can be NULL when the designation is not from a logical reference.
•  from_logical—Specifies if the component must be designated using logical references.
To undesignate a connector, call the function ProConnectorUndesignate().
Function ProConnectorParamGet() retrieves a single parameter for the specified connector. This function supports only single-valued parameters. If you specify a multivalued parameter, the function returns PRO_TK_E_NOT_FOUND.
Use function ProConnectorParamDelete() to remove a single parameter from the specified connector. This function deletes both single- and multi-valued parameters.
Function ProConnectorParamsCollect() retrieves all parameters of the specified connector. This function supports both single- and multi-valued parameters.
Function ProConnectorParamsSet() sets all parameters of the specified connector. This function overwrites all existing parameter values with the values in the input parameter array. This function supports both single- and multi-valued parameters.
Function ProConnectorsFromLogicalGet() returns a list of connector names in the specified assembly for which data has been imported from a logical reference but which have not yet been created. Refer to the Creo Parametric Cabling Help and Creo Parametric Harness Help for more information on logical references.
Managing Cables and Bundles
Functions Introduced:
Use the functions ProCableCreate() and ProCableAndConductorsCreate() to create a new cable or wire in a specified harness. The type of cable created corresponds to the spool type. This function creates all required parameters with default values. If the cable or wire name has already been imported from a wire list, then parameters from that reference are used instead of default values.
Note
The function ProCableAndConductorsCreate() also creates conductors if needed. Pass the value of the input argument create_conductors as PRO_B_TRUE to create conductors.
Use function ProBundleCreate() to create a new bundle in a specified harness. The type of bundle corresponds with the spool type. This function creates all required parameters with default values.
Use the function ProCablesegmentInfoIsInBundle() to identify if the specified cable segment runs into a bundle. This function returns the name of the bundle only if the specified cable segment runs into a bundle.
A network is a series of locations that defines default paths to automate the process to route cables. While routing a cable through a network, the application routes the cable along the network using the shortest calculated path. Cables can only enter and exit a network path through a network location.
Use the function ProNetworkCreate() to create a new network in the specified harness.
The function ProNetworkGet() gets the network for the specified harness.
The input argument harness is specified using the handle ProHarness. The output argument p_cable is the handle to the new network and specified using the class ProCable.
A wire list contains information about the reference designator, pin-to-pin connection information, and parameter values of connectors, pins, spools, wires, and cables.
Use the function ProCablingSchematicswirelistImport() to import the Creo Schematics wire list from the specified file. The input arguments are as follows:
•  p_assem—Input assembly specified using the object ProAssembly.
•  filename—Full path to the input file name including the extension
•  layer_names—Pointer to the array of layer names in the file and is specified using the class ProName.
The function ProCablingSchematicsLayerNamesGet() gets the Creo Schematics layer list from the specified file. The input argument filename is the full path to the input file name including the extension. The output argument layer_names is the pointer to the array of layer names in the file and is specified using the class ProName
Cable Parameters
Functions Introduced:
Function ProCableParameterGet() retrieves a single parameter for the specified cable. This function supports only single-valued parameters. If you specify a multivalued parameter, the function returns PRO_TK_E_NOT_FOUND.
Use ProCableParameterDelete() to remove a single parameter from the specified cable. This function deletes both single- and multi-valued parameters.
Function ProCableParametersCollect() retrieves all parameters of the specified cable. This function supports both single- and multi-valued parameters.
Function ProCableParametersSet() sets all parameters of the specified cable. This function overwrites all existing parameter values with the values in the input parameter array. This function supports both single- and multi-valued parameters.
Function ProCableparammemberFree() releases the memory assigned to the ProCableparam object. Function ProCableparamproarrayFree() releases the memory assigned to the array of ProCableparam objects. The ProCableparam object stores the names and values of cable parameters.
Function ProCablesFromLogicalGet() returns a list of cable names in the specified assembly for which data has been imported from a logical reference but which have not yet been created.
Use function ProCablesFromLogicalCreate() to create instances of cables for which logical data exists.
The function ProCablesFromLogicalAllCreate() creates cables and conductors from logical references. Cables are created using the spool features. If a cable already has a spool feature defined for it, then such cables are created using the existing spools in the model. If the spool feature is not defined for a cable, then this function also creates spools for such cables.
Refer to the Creo Parametric Cabling Help and Creo Parametric Harness Help for more information on logical references.
The function ProCableLocationsOnSegEndGet() returns the start and end location of each segment for the specified cable. The locations are returned as a ProArray.
The functions ProOutputFileMdlnameWrite() and ProInputFileRead() can be used with the option PRO_CABLE_PARAMS_FILE to export and import (and therefore edit) parameters on the specified cable.
Use the function ProCableTessellationGet() to get the tessellation for the specified input cable. Specify the following parameters as input arguments to create the surface tessellation:
•  cable—Specify the input cable on which the tessellation is to be created.
•  input_data—Specify the input data used for the tessellation such as AngleControl, ChordHeight, StepSize and so on. You can choose the options to use when generating a tessellation for the input cable.
Note
You must set the configuration option display_thick_cables toyes before using this API.
Use the function ProCablesegmentInfoIsNew() to identify if the specified cable segment with location information is connected to the previous segment.
Use the function ProCablesegmentInfoPointsGet() to get an array of points, tangents and location Ids for the specified cable segment.
Use the function ProCablesegmentInfosGet() to collect cable segments with location Ids of the cable segments present within the specified cable.
The following example shows a sample cable parameters file. Like the file for connector parameters, the parameter names and values are separated by tab characters.
Cable Parameters File
! Enter or modify parameters for the cable.
! You can use the help functionality of Pro/TABLE
! to enter pre-defined parameters.
! Cable Name
NAME    WIRE_2
! Spool Name
SPOOL   24Y
! Modify the "DIRECTION" parameter for the end type of this cable.
!               REF_DES ENTRY_PORT      DIRECTION
END_TYPE        MOTOR   ENTRY1          FROM
END_TYPE        XCONN2  ENTRY1          TO
Cable Identifiers and Types
Functions Introduced:
The functions ProCableByNameGet() and ProCableNameGet() provide the handle of a cable given its name. The functions also return the cable name when supplied with the handle.
The function ProCableTypeGet() provides the type of a named cable. The possible types are as follows:
•  A wire—A single conductor
•  A cable—With several conductors
•  A bundle—A collection of other wires, cables, and bundles
Cable Cosmetic Features
Functions Introduced:
The function ProCableCosmeticFeatureCreate() creates a cabling cosmetic feature. The types of cabling cosmetic features are tie wraps, markers, and tape. The selected cable location or cable segment point to use for the feature creation. If creating a tape feature, this must contain a cable location. If creating a marker, this must contain a point on the cable segment. If creating a tie wrap, this could be a cable location or a point on a cable segment.
Use the function ProCableCosmeticFeatureTypeGet() to retrieve the type of the specified cosmetic feature. The enumerated data type ProCableCosmeticType is used to define the types of cosmetic features.
The function ProCableCosmeticDistanceGet() retrieves the position of a cosmetic feature relative to the start or end of a cable segment. The output arguments are listed below:
•  p_offset—Distance of the cosmetic feature from the start or end of a segment.
•  p_start—Boolean value which indicates if the distance is measured from the start position of a segment.
Use the function ProCablelocationMaxDiameterGet() to retrieve the maximum diameter of the location for the specified harness.
Use the function ProCablelocationHeightDimensionGet() to retrieve the height dimension for the specified cable location. The function returns the error PRO_TK_BAD_CONTEXT if the specified location does not have a height dimension.
The functions ProCableTapeWindsGet() and ProCableTapeWindsSet() provide access to the number of winds in a tape cosmetic feature.
The function ProCableTapeFeatSpoolGet() returns the spool for the specified tape feature.
Use the function ProFeatureIsCableCosmetic() to check if the specified feature is a cabling cosmetic feature. Cabling cosmetic feature comprises of tie wraps, markers, and tape. For more information on cabling cosmetic feature, refer to the Creo Parametric Help.
Use the function ProCableCosmeticfeatureEntityGet() to get the entity for the cabling cosmetic feature. This function returns a line entity for the tie wrapper and tape types of cosmetic features, and spline entity is returned if the cosmetic feature is of the a marker type.
Use the function ProCableCosmeticfeatureThicknessGet() to get the thickness of the specified input cable cosmetic feature.
Use the function ProCableCosmeticfeatureReferencethicknessGet() to obtain the thickness of the reference cable which is wrapped by the input cable cosmetic feature.
Cable Connectivity
Function Introduced:
The function ProCableLogicalEndsGet() identifies the entry ports and their owning connectors to which the specified cable should be connected. This function depends on the connector parameters SIGNAL and PIN_ASSIGN. A cable connects logically to an entry port if the connector has a PIN_ASSIGN parameter that relates a PIN_ID value to that CABLE_NAME, and a SIGNAL parameter that relates the same PIN_ID value to that ENTRY_PORT name.
In the sample connector parameters file, the cable WIRE_2 connects to connector MOTOR, entry port ENTRY1.
A cable can have logical ends, even if it has not yet been routed.
The output of the function ProCableLogicalEndsGet() is in the form of two Pro/Selection structures for the coordinate system datums that represent the entry ports.
Cable Routing Locations
Functions Introduced:
The locations though which a cable is routed are identified by ProCableLocation structures, which are of the same structure as ProModelItem. The ProCableLocationsCollect()function provides an array of the structures for the locations through which the specified cable is routed. The function ProHarnessLocationsCollect() provides an array of the structures for the locations in a specified harness.
The function ProCablelocationTypeGet() gives the type of a specified location. The following table lists the valid location types.
Location Type
Equivalent Command in the CBL ROUTE Menu
PRO_LOC_CONNECTOR
Connector
PRO_LOC_POINT
Pnt/Vertex
PRO_LOC_FREE
Free
PRO_LOC_DEPENDENT
Dependent
PRO_LOC_AXIS
Along Axis
PRO_LOC_USE_DIR
Use Dir
PRO_LOC_OFFSET
Offset
PRO_LOC_SPLICE
Splice
PRO_LOC_LOC
Location
PRO_LOC_OFFSET_CSYS
Coordinate Offset
PRO_LOC_OFFSET_AXIS
Axis Offset
The function ProCablelocationPointGet() provides the XYZ coordinates of the location in the coordinate system of the harness.
The function ProCablelocationCablesGet()provides an array of the names of cables routed through the specified location.
Cable Geometry
Functions Introduced:
The function ProCableLengthGet() provides the length of the specified wire within a specified harness.
The functions ProCableSegmentsGet() and ProCablesegmentPointsGet() provide the geometry of a named wire, bundle, or cable within a specified harness part. The geometry of a wire or cable is divided into a number of segments, each of which represents a region where the wire or cable is bundled with other wires and cables. The geometry of each such segment is described by a series of three-dimensional locations and tangent vectors.
The function ProCablesegmentIsInBundle() determines whether a cable segment runs into a bundle.
The function ProCablesegmentIsNew() determines whether the cable segment is connected to a previous cable segment.
Measuring Harness Clearance
Function Introduced:
The function ProCableClearanceCompute() determines the minimum distance between two items in a harness. The items can be of any of the following types, in any combination:
•  Part
•  Surface
•  Cable
•  Cable location
The inputs identify the two items in terms of ProSelection structures. The function outputs a flag to show whether the two items interfere, and, if they do not interfere, the function also returns the three-dimensional locations of the two nearest points.
Cable Routing
Functions Introduced:
To Route a Group of Cables Through a Sequence of Locations:
1. Call ProCableRoutingStart() to identify the cables to be routed.
2. Call ProCablelocationrefAlloc() to create a routing reference location structure.
3. Call ProCableThruLocationRoute() for each location through which to route the cables.
4. Call ProCablelocationrefFree() to free the location reference.
5. Call ProCableRoutingEnd() to complete the routing.
6. Call ProSolidRegenerate() to make Creo Parametric calculate the resulting cable geometry and create the necessary cable features.
Note
You must also call the function ProWindowRepaint() to see the new cables.
After the call to ProCableRoutingStart(), the information about the routing in progress is contained in an opaque data structure ProRouting that ProCableRoutingStart() provides. This pointer is then given as an input to the functions ProCableThruLocationRoute() and ProCableRoutingEnd().
The inputs to ProCableRoutingStart() are the cabling assembly and harness handles, and an array of cables.
The input to ProCableThruLocationRoute() is a structure of type ProCablelocationref, which contains all the necessary information about the location through which to route the cables.
The following table shows the possible values of the type field, and the values that other fields need for each type.
type
refs
axis_flip
offsets
PROLOC_CONNECTOR
The coordinate system datum for the entry port
PROLOC_POINT
The datum point
PROLOC_AXIS
The axis
0 or 1 to show the routing direction
-—
PROLOC_OFFSET
The coordinate system datum to define the offset directions
Offset distances from the previous location
PROLOC_LOC
An existing routing location
The function ProCableThruLocationRoute() also outputs an array of the structures for the locations created as a result of the call. (The function usually creates a single location, but creates two in the case of routing through an axis.)
As input, the ProCableRoutingEnd() function takes only the void* for the routing data.
Deleting Cable Sections
Function Introduced:
The function ProCableSectionsDelete() deletes the section of cables that lies between designated locations. ProCableSectionsDelete() does not delete loom bundle cable sections.