Constructors
Properties
Methods
CreateFromDocument
#Create a set of snapping constraints from the attributes in a document.
Parameters:
| document (Document) | Document to peruse. |
| includeSelected (bool) | If true, selected objects are included in the snapping set. |
| includeUnselected (bool) | If true, unselected objects are included in the snapping set. |
| filter (HashSet<Guid> = null) | Omit all objects which match one of the filter ids, as well as all groups containing any filter ids. |
DrawSnappingBoxes
#public void DrawSnappingBoxes(Graphics graphics)
Draw all snapping boxes to a graphics context. Handy for debugging.
Parameters:
| graphics (Graphics) |
SnapObject
#public void SnapObject(IDocumentObject target, SnappingSettings settings, RectangleF visibleLimit, out SnappingAction snapX, out SnappingAction snapY)
Snap a specific object into place, using its current bounds.
Parameters:
| target (IDocumentObject) | Target object. |
| settings (SnappingSettings) | Snapping settings. |
| visibleLimit (RectangleF) | Limiting bounds for snap searches. |
| snapX (out SnappingAction) | Snap action in the X direction, if any. |
| snapY (out SnappingAction) | Snap action in the Y direction, if any. |
SnapRectangle
#public void SnapRectangle(RectangleF target, SnappingSettings settings, RectangleF visibleLimit, out SnappingAction snapX, out SnappingAction snapY)
Snap a custom rectangle into place.
Parameters:
| target (RectangleF) | Target box to snap. |
| settings (SnappingSettings) | Snapping settings to use. |
| visibleLimit (RectangleF) | Limiting bounds for snap searches. |
| snapX (out SnappingAction) | Snapping action along x, if any. |
| snapY (out SnappingAction) | Snapping action along y, if any. |
SnapWires
#public static SnappingAction SnapWires(IDocumentObject target, RectangleF boundsOverride, SnappingSettings settings)
Snap an object into place based on horizontal wire constraints.
Parameters:
| target (IDocumentObject) | Object to snap. |
| boundsOverride (RectangleF) | Override for the bounds of the target object. We need this because the target object is in the process of being dragged, and as such hasn't yet received it's newest location. Snaping actions are modifications to the dragging offset, so we need to know how the target object is about to be moved. |
| settings (SnappingSettings) |
Returns: Possible wire snapping action.
SnapWires
#Snap an object into place based on horizontal wire constraints.
Parameters:
| target (IDocumentObject) | Object to snap. |
| settings (SnappingSettings) |
Returns: Possible wire snapping action.