Table of Contents

Class CadCustomSnap

Namespace
OpenCAD2D.Plugins
Assembly
OpenCAD2D.Core.dll

An object snap a plugin adds, as AutoCAD's CustomObjectSnapMode: a name, a keyword typed as an override, a glyph, the entity types it applies to and the points the plugin works out for an entity under the cursor. Beyond AutoCAD, the window lists it in the Object Snap tab of Drafting Settings, the OSNAP status menu and the Shift+right-click menu, and turns it on and off as it does the built-in snaps, keeping the choice in the settings by keyword.

public sealed class CadCustomSnap
Inheritance
CadCustomSnap
Inherited Members

Remarks

A snap on gives its points while object snap (F3) is on, and competes with the built-in snaps by distance from the cursor: at equal distance the built-in one wins, then the snap loaded first, then the first point the finder gave. A snap applies to model and paper space as they are shown, and to the model space a viewport of a layout shows (the finder works in model coordinates and the point is taken to the sheet where the viewport shows it, the layers frozen in the viewport left out). It applies to the entities inside the blocks under the aperture too, as a copy of each placed where the references draw it (Entity, BlockReferences); a block of an external reference, and the cells of an array of a block, are not gone into. A point typed after the snap's keyword is snapped as the built-in snaps snap one: the finder is given the entities within the aperture of the typed point, and the point it gives nearest the typed point is taken, however far.

Constructors

CadCustomSnap(string, string, CadSnapFinder)

Makes a snap.

Properties

EntityTypes

Gets the types of entity the snap applies to, as AutoCAD's ApplyToEntityType: the entities whose type is one of them, or a subclass of one. Empty, until filled, for every entity. Each must derive from DxfEntity, which AddObjectSnap(CadCustomSnap) checks.

Finder

Gets what gives the points.

Glyph

Gets or sets the marker: strokes in pixels about the snap point, Y down, as Strokes(CadSnapKind) gives them, drawn in the marker colour and width. Null, until set, for the default glyph: a square 9 across with a filled dot of radius 1.2 in its centre.

IsOnByDefault

Gets or sets whether the snap starts on for a user who has never chosen it: false until set.

Keyword

Gets the keyword typed as an override, in capitals: "CTOP".

Name

Gets the name the menus, Drafting Settings and the snap tip show: "Circle top".

Methods

ToString()