Table of Contents

CadCustomSnap

from OpenCAD2D.Plugins import CadCustomSnap

class CadCustomSnap(System.Object) ยท CadCustomSnap in the .NET reference

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.

Constructors

__init__

.NET

def __init__(self, name: str, keyword: str, finder: CadSnapFinder) -> None

Makes a snap.

Properties and fields

EntityTypes

.NET

@property
def EntityTypes(self) -> System.Collections.Generic.IList[System.Type]

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 CadPluginHost.AddObjectSnap checks.

Finder

.NET

@property
def Finder(self) -> CadSnapFinder

Gets what gives the points.

Glyph

.NET

@property
def Glyph(self) -> System.Collections.Generic.IReadOnlyList[CadMarkerStroke] | None
@Glyph.setter
def Glyph(self, value: System.Collections.Generic.IReadOnlyList[CadMarkerStroke] | None) -> None

Gets or sets the marker: strokes in pixels about the snap point, Y down, as CadSnapMarker.Strokes 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

.NET

@property
def IsOnByDefault(self) -> bool
@IsOnByDefault.setter
def IsOnByDefault(self, value: bool) -> None

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

Keyword

.NET

@property
def Keyword(self) -> str

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

Name

.NET

@property
def Name(self) -> str

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

Methods

ToString

.NET

def ToString(self) -> str