Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / PlaceCableTray Method
List of point information, including their position in space and also the orientation mode. The order matters!
The requested width of the new cable tray. If not specified, a default value will be used.
The requested height of the new cable tray. If not specified, a default value will be used.
Bending radius of the cable tray.If not specified, a default value will be used.
An optional point of an existing cable tray to start placing from.
Example
In This Topic
    PlaceCableTray Method
    In This Topic
    Place a cable tray to this designer.
    Syntax

    Parameters

    positions
    List of point information, including their position in space and also the orientation mode. The order matters!
    width
    The requested width of the new cable tray. If not specified, a default value will be used.
    height
    The requested height of the new cable tray. If not specified, a default value will be used.
    bendingRadius
    Bending radius of the cable tray.If not specified, a default value will be used.
    splitPoint
    An optional point of an existing cable tray to start placing from.

    Return Value

    Placed cable tray.
    Exceptions
    ExceptionDescription
    Api is not in an initialized state. You can get current state from EPLAN.Harness.API.Studio.Status property. If API is uninitialized, you can initialize it by calling EPLAN.Harness.API.Studio.Init method. If API is in failed state, you can not resurrect it.
    The object is in invalid state. Obtain a new one.
    This operation was denied because of your license.
    This file is not opened.
    Example
    This example shows how to place a new cable tray.
    IOccCableTray cTray = wsp.PlaceCableTray(new List<CableTrayPointPlacementInfo>()
    {
    	new CableTrayPointPlacementInfo(new PlacePosition(new TransformProperty<LengthProperty>
    	(
    		new LengthProperty(1000, Unit.Millimeter),
    		new LengthProperty(1000, Unit.Millimeter),
    		new LengthProperty(1000, Unit.Millimeter)
    	)), ApiTrayPlacementMode.Horizontal),
    	new CableTrayPointPlacementInfo(new PlacePosition(new TransformProperty<LengthProperty>
    	(
    		new LengthProperty(2000, Unit.Millimeter),
    		new LengthProperty(2000, Unit.Millimeter),
    		new LengthProperty(1000, Unit.Millimeter)
    	)), ApiTrayPlacementMode.Horizontal),
    	new CableTrayPointPlacementInfo(new PlacePosition(new TransformProperty<LengthProperty>
    	(
    		new LengthProperty(3000, Unit.Millimeter),
    		new LengthProperty(3000, Unit.Millimeter),
    		new LengthProperty(-1000, Unit.Millimeter)
    	)), ApiTrayPlacementMode.Vertical),
    	new CableTrayPointPlacementInfo(new PlacePosition(new TransformProperty<LengthProperty>
    	(
    		new LengthProperty(4000, Unit.Millimeter),
    		new LengthProperty(4000, Unit.Millimeter),
    		new LengthProperty(-1000, Unit.Millimeter)
    	)), ApiTrayPlacementMode.Vertical),
    		new CableTrayPointPlacementInfo(new PlacePosition(new TransformProperty<LengthProperty>
    	(
    		new LengthProperty(4000, Unit.Millimeter),
    		new LengthProperty(5000, Unit.Millimeter),
    		new LengthProperty(-1000, Unit.Millimeter)
    	)), ApiTrayPlacementMode.Horizontal)
    }, new LengthProperty(400, Unit.Millimeter), new LengthProperty(200, Unit.Millimeter), new LengthProperty(500, Unit.Millimeter));
    This example shows how to place a new cable tray starting from an existing point.
    // Find an existing point to start from:
    ICableTrayPoint occSplitPoint = wsp.GetAllOccurrences().Where(occ => occ.Name == "cp_00002").First() as ICableTrayPoint;
    
    // Create a new tray:
    IOccCableTray cTray = wsp.PlaceCableTray(new List<CableTrayPointPlacementInfo>()
    {
    	new CableTrayPointPlacementInfo(new PlacePosition(new TransformProperty<LengthProperty>
    	(
    		new LengthProperty(1000, Unit.Millimeter),
    		new LengthProperty(1000, Unit.Millimeter),
    		new LengthProperty(0, Unit.Millimeter)
    	)), ApiTrayPlacementMode.Horizontal),
    	new CableTrayPointPlacementInfo(new PlacePosition(new TransformProperty<LengthProperty>
    	(
    		new LengthProperty(2000, Unit.Millimeter),
    		new LengthProperty(2000, Unit.Millimeter),
    		new LengthProperty(0, Unit.Millimeter)
    	)), ApiTrayPlacementMode.Horizontal)
    }, new LengthProperty(400, Unit.Millimeter), new LengthProperty(200, Unit.Millimeter), new LengthProperty(500, Unit.Millimeter),
    occSplitPoint);
    See Also