CadPropertyRow
from OpenCAD2D import CadPropertyRow
class CadPropertyRow(System.Object) ยท CadPropertyRow in the .NET reference
One row of the Properties panel: a label and a value, which may be read-only.
Constructors
__init__
def __init__(self, label: str, value: str, isReadOnly: bool) -> None
Makes a row.
def __init__(
self,
label: str,
value: str,
isReadOnly: bool,
choices: System.Collections.Generic.IReadOnlyList[str],
) -> None
Makes a row whose value is one of a list, as the Justify row of an MTEXT offers Top left to Bottom right.
def __init__(
self,
label: str,
value: str,
setter: System.Func[str, str],
choices: System.Collections.Generic.IReadOnlyList[str] | None = ...,
) -> None
Makes a row that an extension gives the Properties panel and that can be changed: typed into, or one of a list where choices are given. The panel calls setter with the text typed or chosen, as it does for its own rows, when Enter is pressed, the box is left or a choice is made.
Properties and fields
NoText
NoText: ClassVar[str]
The value of a check box that is not ticked.
VariesText
VariesText: ClassVar[str]
The text of a value that differs among the selected entities.
YesText
YesText: ClassVar[str]
The value of a check box that is ticked.
Choices
@property
def Choices(self) -> System.Collections.Generic.IReadOnlyList[str] | None
Gets the values the row offers, as the Text pos vert row of a dimension offers Centered, Above, Outside, JIS and Below; null for a row typed into.
IsCheck
@property
def IsCheck(self) -> bool
Gets whether the value is a check box, which CadPropertyRow.Value says is CadPropertyRow.YesText or CadPropertyRow.NoText.
IsReadOnly
@property
def IsReadOnly(self) -> bool
Gets whether the value cannot be edited.
Kind
@property
def Kind(self) -> CadPropertyKind
Gets what kind of value the row holds, which tells the window what to offer: CadPropertyKind.Text for a row typed into, CadPropertyKind.Choice where choices are given, CadPropertyKind.Check for a check box made with CadPropertyRow.Check, and the others for the rows CadPropertyRow.Number, CadPropertyRow.Length, CadPropertyRow.Angle, CadPropertyRow.Point, CadPropertyRow.Color, CadPropertyRow.Layer, CadPropertyRow.Linetype and CadPropertyRow.Lineweight make. A read-only row from CadPropertyRow.Check is Text.
Label
@property
def Label(self) -> str
Gets the label.
Setter
@property
def Setter(self) -> System.Func[str, str] | None
Gets what changes the value of a row an extension gave, given the text typed or chosen (CadPropertyRow.YesText or CadPropertyRow.NoText for a check box): it returns null where the change was made, else the words of the refusal. Null for the rows the presenter makes, which it commits itself.
Value
@property
def Value(self) -> str
Gets the value as text.
Varies
@property
def Varies(self) -> bool
Gets whether the selected entities differ in this property.
Methods
Angle
@staticmethod
def Angle(label: str, radians: float, document: CadDocument, setter: System.Func[float, str]) -> CadPropertyRow
Makes a row for an angle, written and read in the drawing's angle units, AUNITS and AUPREC: 90 degrees is "90" in decimal degrees to no places, and "90d0'0\"" in degrees, minutes and seconds. The value is in radians from the X axis. Text that does not read is refused with "<label> is a number." and the setter is not called.
Check
@staticmethod
def Check(label: str, isOn: bool, setter: System.Func[str, str]) -> CadPropertyRow
Makes a row that is a check box, ticked or not, that an extension gives the Properties panel: ticking it calls setter with CadPropertyRow.YesText, and clearing it with CadPropertyRow.NoText. Where the setter is null the row only shows the answer, as text.
Color
@staticmethod
def Color(label: str, color: DxfColor, setter: System.Func[DxfColor, str]) -> CadPropertyRow
Makes a row for a colour, written as the palette writes one (ByLayer, ByBlock, Red to White, an index 1 to 255, or 255,128,0) and read the same way; the window offers its list of colours with Select Color. Text that does not read is refused with the palette's own words and the setter is not called.
Layer
@staticmethod
def Layer(label: str, layer: str, setter: System.Func[str, str]) -> CadPropertyRow
Makes a row for a layer's name; the window offers the layers of the drawing. The name typed or chosen goes to the setter as it is, which refuses one the drawing has not.
Length
@staticmethod
def Length(label: str, value: float, document: CadDocument, setter: System.Func[float, str]) -> CadPropertyRow
Makes a row for a length, written and read in the drawing's units, LUNITS and LUPREC: 12.5 is "12.5000" in decimal units to four places, and 14 inches typed as 1'2" is read in architectural units. Text that does not read is refused with "<label> is a number." and the setter is not called.
Linetype
@staticmethod
def Linetype(label: str, linetype: str, setter: System.Func[str, str]) -> CadPropertyRow
Makes a row for a linetype's name; the window offers the linetypes of the drawing. The name typed or chosen goes to the setter as it is, which refuses one the drawing has not.
Lineweight
@staticmethod
def Lineweight(label: str, lineweight: DxfLineWeight, setter: System.Func[DxfLineWeight, str]) -> CadPropertyRow
Makes a row for a lineweight, written as the palette writes one (ByLayer, ByBlock, Default, or 0.25 mm) and read the same way; the window offers AutoCAD's widths. Text that does not read is refused with the palette's own words and the setter is not called.
Number
@staticmethod
def Number(label: str, value: float, setter: System.Func[float, str]) -> CadPropertyRow
Makes a row for a number typed as it is, in the invariant culture: 12.5, whatever the machine's separator. Typing "abc" is refused with "<label> is a number." and the setter is not called.
Point
@staticmethod
def Point(
label: str,
value: GeoPoint3,
document: CadDocument,
setter: System.Func[GeoPoint3, str],
) -> System.Collections.Generic.IReadOnlyList[CadPropertyRow]
Makes the three rows of a point, "<label> X", "<label> Y" and "<label> Z", each a CadPropertyRow.Length; typing one gives the setter the point with that coordinate changed and the others as they were. With a setter, the row being edited shows a pick-point button: it asks "Pick a point in the drawing:" on the command line, with a rubber band from the point, and a point picked gives the setter the whole point, its X and Y the picked ones and its Z as it was, as one change.