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
@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
@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
@property
def Description(self) -> str | None
Gets what the setting does; null for nothing.
Kind
@property
def Kind(self) -> CadSettingKind
Gets the kind of value it holds.
Label
@property
def Label(self) -> str
Gets the label the presenter shows: "Text height".
Maximum
@property
def Maximum(self) -> float
Gets the greatest value of a number, inclusive; infinity for none.
Minimum
@property
def Minimum(self) -> float
Gets the least value of a number, inclusive; minus infinity for none.
Name
@property
def Name(self) -> str
Gets the name of the property: TextHeight.
Value
@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
def ToString(self) -> str