public IEnumerable<IOccConstraintSimple> LockEndPointsToConnector( IEnumerable<IOccEndControlPoint> endPoints )
Parameters
- endPoints
- Collections of endpoints
Return Value
Created constraint.
public IEnumerable<IOccConstraintSimple> LockEndPointsToConnector( IEnumerable<IOccEndControlPoint> endPoints )
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.ArgumentNullException | |
EPLAN.Harness.API.Exceptions.ArgumentException | |
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. |
// Initialize API HpdApi api = HpdApi.GetInstance(); api.Init(); // Open a project and a workdesk. Project project = api.OpenProject(@"d:\Harness proD 2.9\Projects\Demo\Demo.hxproj"); Variant variant = project.GetVariants()[0]; variant.Open(false, false); Designer designer = variant.GetWorkdesks().FirstOrDefault(w => w.Name == "Workdesk_1"); designer.Open(false, false); // Lock position between a control point and a connected connector. IOccEndControlPoint cp = workdesk.GetAllOccurrences<IOccEndControlPoint>().FirstOrDefault(c => c.Name == "cp_00158"); designer.LockEndPointsToConnector(new [] { cp }); // Save changes and close documents. designer.Save(); designer.Close(); variant.Close(); project.Close(); api.Close();