// 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
}
);