Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / PlaceRapidPrototypeConnector Method
Position of the RP connector.
Rotation of the RP connector.
Rapid prototype connector definition. If the definition is null the default values from settings are used.
Example
In This Topic
    PlaceRapidPrototypeConnector Method
    In This Topic
    Place a rapid prototype connector.
    Syntax

    Parameters

    position
    Position of the RP connector.
    rotation
    Rotation of the RP connector.
    definition
    Rapid prototype connector definition. If the definition is null the default values from settings are used.

    Return Value

    Created rapid prototype connector.
    Exceptions
    ExceptionDescription
    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.
    This file is not opened.
    Example
    This example shows how to place a blue rapid prototype connector with 5 pins to a specific position in workspace.
    // Obtain the workspace beforehand.
    Workspace workspace = ...
    
    // Define a position for the connector.
    TransformProperty<LengthProperty> position = new TransformProperty<LengthProperty>
    (
    	new LengthProperty(0, Unit.Millimeter),
    	new LengthProperty(0, Unit.Millimeter),
    	new LengthProperty(0, Unit.Millimeter)
    );
    
    // Define a rotation for the connector.
    TransformProperty<AngleProperty> rotation = new TransformProperty<AngleProperty>
    (
    	new AngleProperty(0, Unit.Degree),
    	new AngleProperty(0, Unit.Degree),
    	new AngleProperty(0, Unit.Degree)
    );
    
    // Create a definition for the connector.
    RapidConnectorDefinition rapidConnectorDefinition = new RapidConnectorDefinition()
    {
    	ConnectorColor = Color.Blue,
    	PinCount = 5,
    	RibbonConnector = false
    };
    
    // Insert the connector.
    IOccConnector rapidConnector = workspace.PlaceRapidPrototypeConnector(position, rotation, rapidConnectorDefinition);
    This example shows how to place a green cuboid rapid prototype ribbon connector with pin size 15 mm to the specific position in workdesk.
    // Obtain the workdesk beforehand.
    Workdesk workdesk = ...
    
    // Define a position for the connector.
    TransformProperty<LengthProperty> position = new TransformProperty<LengthProperty>
    (
    	new LengthProperty(10, Unit.Millimeter),
    	new LengthProperty(10, Unit.Millimeter),
    	new LengthProperty(0, Unit.Millimeter)
    );
    
    // Define a rotation for the connector.
    TransformProperty<AngleProperty> rotation = new TransformProperty<AngleProperty>
    (
    	new AngleProperty(180, Unit.Degree),
    	new AngleProperty(0, Unit.Degree),
    	new AngleProperty(0, Unit.Degree)
    );
    
    // Create a definition for the connector.
    RapidConnectorDefinition rapidConnectorDefinition = new RapidConnectorDefinition()
    {
    	PinColor = Color.Green,
    	PinSize = new LengthProperty(15, Unit.Millimeter),
    	Shape = RapidConnectorShape.Cuboid,
    	RibbonConnector = true
    };
    
    // Insert the connector.
    IOccConnector rapidConnector = workdesk.PlaceRapidPrototypeConnector(position, rotation, rapidConnectorDefinition);
    This example shows how to place a rapid prototype connector with default values to the specific point in workspace.
    // Obtain the workspace beforehand.
    Workspace workspace = ...
    
    // Insert the connector, defining only position and rotation.
    IOccConnector rapidConnector = workspace.PlaceRapidPrototypeConnector
    (
    	new TransformProperty<LengthProperty>
    	(
    		new LengthProperty(2, Unit.Centimeter),
    		new LengthProperty(20, Unit.Millimeter),
    		new LengthProperty(-20, Unit.Millimeter)
    	),
    	new TransformProperty<AngleProperty>
    	(
    		new AngleProperty(45, Unit.Degree),
    		new AngleProperty(90, Unit.Degree),
    		new AngleProperty(-60, Unit.Degree)
    	)
    	// Rapid connector definition is null -> use default values from settings.
    );
    See Also