public void MergeControlPoints( IControlPoint mergedPoint, IControlPoint destinationPoint )
Parameters
- mergedPoint
- Control point which will be moved and merged.
- destinationPoint
- Destination control point which will stay in place.
public void MergeControlPoints( IControlPoint mergedPoint, IControlPoint destinationPoint )
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.HpdApiNotInitializedException | 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. |
EPLAN.Harness.API.Exceptions.ObjectInvalidException | The object is in invalid state. Obtain a new one. |
EPLAN.Harness.API.Exceptions.FileClosedException | This file is not opened. |
EPLAN.Harness.API.Exceptions.FileOpenedAsReadOnlyException | You can not perform this action on a document opened as read only. |
EPLAN.Harness.API.Exceptions.ArgumentException | Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property. |
EPLAN.Harness.API.Exceptions.ArgumentNullException | Argument is null. |
Leading part or grommet never moves, even when it is set as mergedPoint.
Clip, special electrical component or inline ribbon pin always survives this command, even when it is set as mergedPoint.
// Get and open a designer. Project project = api.OpenProject(@"c:\Projects\Demo\Demo.hxproj"); Variant variant = project.GetVariants()[0]; Designer designer = variant.GetWorkspaces().FirstOrDefault(d => d.Name == "Workspace_1"); designer.Open(false, false); // Select the control points to merge IControlPoint mergedPoint = designer.GetAllOccurrences<IControlPoint>().First(p => p.Name == "ControlPoint1"); IControlPoint destinationPoint = designer.GetAllOccurrences<IControlPoint>().First(p => p.Name == "ControlPoint2"); try { designer.MergeControlPoints(mergedPoint, destinationPoint); // Control points are merged into the destination control point (except of few exceptions - see remarks). } catch (Exceptions.ArgumentException ex) { // One of these points is not suitable for merging. See the exception message (ex.Message). }