Table of Contents

CadPluginSetting

from OpenCAD2D.Plugins import CadPluginSetting

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

One setting a plugin declares with CadSettingAttribute: its label, kind, default and range, as the presenter draws them, and its value, read from and written to the plugin's property. A text height declared with Minimum = 0.1 and set to 0.05 is refused, and the plugin keeps the height it had.

Properties and fields

Choices

.NET

@property
def Choices(self) -> System.Collections.Generic.IReadOnlyList[str]

Gets the names a choice offers, in the order the enumeration declares them; empty for any other kind.

Default

.NET

@property
def Default(self) -> Any

Gets the value the property had when the plugin was loaded: a double, an int, a bool, a string or, for a choice, the name of the value.

Description

.NET

@property
def Description(self) -> str | None

Gets what the setting does; null for nothing.

Kind

.NET

@property
def Kind(self) -> CadSettingKind

Gets the kind of value it holds.

Label

.NET

@property
def Label(self) -> str

Gets the label the presenter shows: "Text height".

Maximum

.NET

@property
def Maximum(self) -> float

Gets the greatest value of a number, inclusive; infinity for none.

Minimum

.NET

@property
def Minimum(self) -> float

Gets the least value of a number, inclusive; minus infinity for none.

Name

.NET

@property
def Name(self) -> str

Gets the name of the property: TextHeight.

Value

.NET

@property
def Value(self) -> Any
@Value.setter
def Value(self, value: object) -> None

Gets or sets the value: a double, an int, a bool, a string or, for a choice, the name of the value. A value of another type is converted as the invariant culture reads it, so "2.5" sets a number.

Methods

ToString

.NET

def ToString(self) -> str