Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / PlaceRapidPrototypeRibbonCable Method / PlaceRapidPrototypeRibbonCable(IOccRibbonPin,IOccRibbonPin,List<PlacePosition>,List<Connection>,RapidRibbonCableDefinition) Method
First pin to connect to.
Second pin to connect to.
Control points of the ribbon cable.
Connections of wires of this ribbon cable.
Rapid prototype ribbon cable definition. If the definition is null the default values from settings are used.
Example
In This Topic
    PlaceRapidPrototypeRibbonCable(IOccRibbonPin,IOccRibbonPin,List<PlacePosition>,List<Connection>,RapidRibbonCableDefinition) Method
    In This Topic
    Place a rapid prototype ribbon cable.
    Syntax

    Parameters

    ribbonPin1
    First pin to connect to.
    ribbonPin2
    Second pin to connect to.
    ribbonCableControlPoints
    Control points of the ribbon cable.
    connections
    Connections of wires of this ribbon cable.
    definition
    Rapid prototype ribbon cable definition. If the definition is null the default values from settings are used.

    Return Value

    Placed rapid prototype ribbon cable.
    Exceptions
    ExceptionDescription
    This file is not opened.
    Api is not in an initialized state. You can get current state from EPLAN.Harness.API.HpdApi.Status property. If API is uninitialized, you can initialize it by calling EPLAN.Harness.API.HpdApi.Init method. If API is in failed state, you can not resurrect it.
    The object is in invalid state. Obtain a new one.
    Thrown when the occurrence is not part of this document.
    Remarks

    All connection pins must be children of ribbonPin1 or ribbonPin2.

    Count of connections must be less than or equal to the count of wires of the rapid prototype ribbon cable.

    Example
    This example shows how to place an orange rapid prototype ribbon cable with 3 wires between two ribbon pins and connect its virtual wires with the virtual pins of these ribbon pins.
    // Obtain workspace beforehand.
    Workspace workspace = ...
    
    // The ribbon cable with will be connected to the following pins:
    OccWsRibbonPin ribbonPin1 = ...
    OccWsRibbonPin ribbonPin2 = ...
    
    // Connections of virtual wires of this ribbon cable.
    List<Connection> connections = new List<Connection>();
    
    // First virtual wire of the ribbon cable will be connected to these virtual pins of a ribbon pin.
    OccWsVirtualPin pin1 = ribbonPin1.Children.OfType<OccWsVirtualPin>().First();
    OccWsVirtualPin pin2 = ribbonPin2.Children.OfType<OccWsVirtualPin>().First();
    connections.Add(new Connection(pin1, pin2));
    
    // 2 more connections...
    // connections.Add(...);
    
    IOccRibbonCable ribbonCable = workspace.PlaceRapidPrototypeRibbonCable(
    	ribbonPin1,
    	ribbonPin2,
    	new List<TransformProperty<LengthProperty>>(),
    	connections,
    	new RapidRibbonCableDefinition()
    	{
    		CableColor = Color.Orange,
    		NumberOfWires = 3
    	}
    );
    This example shows how to place a rapid prototype ribbon cable with values from settings between two ribbon pins and connect its virtual wires.
    // Obtain workdesk beforehand.
    Workdesk workdesk = ...
    
    // The ribbon cable with will be connected to the following pins:
    OccWdRibbonPin ribbonPin1 = ...
    OccWdRibbonPin ribbonPin2 = ...
    
    // Connections of virtual wires of this ribbon cable.
    List<Connection> connections = ...
    
    IOccRibbonCable ribbonCable = workdesk.PlaceRapidPrototypeRibbonCable(ribbonPin1, ribbonPin2, new List<TransformProperty<LengthProperty>>(), connections);
    This example shows how to leave some virtual wires of the rapid prototype ribbon cable unconnected.
    // Obtain workdesk beforehand.
    Workdesk workdesk = ...
    
    // The ribbon cable with will be connected to the following pins:
    OccWdRibbonPin ribbonPin1 = ...
    OccWdRibbonPin ribbonPin2 = ...
    
    // Connections of virtual wires of this ribbon cable.
    List<Connection> connections = new List<Connection>();
    
    // First virtual wire of this ribbon cable will be connected to these virtual pins.
    OccWdVirtualPin pin1 = ribbonPin1.Children.OfType<OccWdVirtualPin>().First();
    OccWdVirtualPin pin2 = ribbonPin2.Children.OfType<OccWdVirtualPin>().First();
    connections.Add(new Connection(pin1, pin2));
    
    // Second virtual wire of this ribbon cable will be unconnected.
    pin1 = null;
    pin2 = null;
    connections.Add(new Connection(pin1, pin2));
    
    // Third virtual wire of this ribbon cable will be connected to these virtual pins.
    pin1 = ribbonPin1.Children.OfType<OccWdVirtualPin>().Last();
    pin2 = ribbonPin2.Children.OfType<OccWdVirtualPin>().Last();
    connections.Add(new Connection(pin1, pin2));
    
    // Fourth and fifth virtual wire of this ribbon cable will be unconnected too, because of missing connection definition for these wires.
    
    IOccRibbonCable ribbonCable = workdesk.PlaceRapidPrototypeRibbonCable(
    	ribbonPin1,
    	ribbonPin2,
    	new List<TransformProperty<LengthProperty>>(),
    	connections,
    	new RapidRibbonCableDefinition()
    	{
    		NumberOfWires = 5
    	}
    );
    This example shows how to place a rapid prototype ribbon cable with several control points.
    // Obtain workspace beforehand.
    Workspace workspace = ...
    
    // The ribbon cable with will be connected to the following pins:
    OccWsRibbonPin ribbonPin1 = ...
    OccWsRibbonPin ribbonPin2 = ...
    
    // Control points in defined positions in space.
    TransformProperty<LengthProperty> controlPoint1 = ...
    TransformProperty<LengthProperty> controlPoint2 = ...
    TransformProperty<LengthProperty> controlPoint3 = ...
    
    // Connections of virtual wires of this ribbon cable.
    List<Connection> connections = ...
    
    IOccRibbonCable ribbonCable = workspace.PlaceRapidPrototypeRibbonCable(ribbonPin1, ribbonPin2, new List<TransformProperty<LengthProperty>> { controlPoint1, controlPoint2, controlPoint3 }, connections);
    See Also