CadSnapMarker
from OpenCAD2D import CadSnapMarker
class CadSnapMarker(System.Object) ยท CadSnapMarker in the .NET reference
AutoCAD's AutoSnap markers as data, so that the canvas, Drafting Settings and a test draw and read the same: each snap kind's shape in pixels about the snap point, CadSnapMarker.Size across, drawn CadSnapMarker.LineWidth wide in CadSnapMarker.ColorOn. Endpoint is a square, Midpoint a triangle, Center a circle, Geometric Center a circle with a dot, Node a circle with a cross, Quadrant a diamond, Intersection a cross, Extension a small cross on a dotted line, Insertion two squares, Perpendicular a right angle, Tangent a circle with a line on top, Nearest an hourglass, Apparent Intersection a cross in a square, Extended Apparent Intersection the same with three dots below, Parallel two slanted lines and a point of object snap tracking a small cross, 4.5 across. A circle is a ring of 24 points.
Properties and fields
LineWidth
LineWidth: ClassVar[float]
The width of a marker's lines, in pixels: 1.5.
Size
Size: ClassVar[float]
The size of a marker across, in pixels: 9.
Methods
ColorOn
@staticmethod
def ColorOn(background: int) -> int
Gets the colour of the markers on a background, as 0xRRGGBB: AutoCAD's yellow, 0xFFFF00, on a dark one, and a dark grey, 0x1A1A1A, on a light one, where yellow would not show; a background is light where its luminance passes half.
NameOf
@staticmethod
def NameOf(kind: CadSnapKind) -> str
Gets the name of a snap kind as AutoCAD's tooltip writes it: "Endpoint", "Geometric Center", "Apparent Intersection".
Strokes
@staticmethod
def Strokes(kind: CadSnapKind) -> System.Collections.Generic.IReadOnlyList[CadMarkerStroke]
Gets the strokes of a snap kind's marker; none for a kind with no marker (none, grid, ortho, polar).