Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / CopyShapeTo Method
Source control path occurrence which shape will be copy to targetPath occurrence.
Target control path occurrence to apply shape from sourcePath occurrence.
Example
In This Topic
    CopyShapeTo Method
    In This Topic
    Copy control path shape to another control path.
    Syntax
    public void CopyShapeTo( 
       IControlPath sourcePath,
       IControlPath targetPath
    )

    Parameters

    sourcePath
    Source control path occurrence which shape will be copy to targetPath occurrence.
    targetPath
    Target control path occurrence to apply shape from sourcePath occurrence.
    Exceptions
    ExceptionDescription
    Thrown when the supplied occurrence cannot be used. E.g. path without any inner control points, path passing through leading part, etc.
    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.
    You can not perform this action on a document opened as read only.
    Example
    This example shows how to copy shape of a bundle to a wire.
    // Open a designer.
    Designer designer = ...
    designer.Open(false, false);
    
    // Find the source bundle.
    IOccBundle bundle = designer.GetAllOccurrences().OfType<IOccBundle>().FirstOrDefault(b => b.Name.Value == "sourceBundle");
    
    // Find the target wire.
    IOccWire wire = designer.GetAllOccurrences().OfType<IOccWire>().FirstOrDefault(w => w.Name.Value == "targetWire");
    
    designer.CopyShapeTo(bundle, wire);
    See Also