CadCalcValue
from OpenCAD2D import CadCalcValue
class CadCalcValue(System.ValueType) ยท CadCalcValue in the .NET reference
A value of the geometry calculator: a whole number, a real number or a vector (a point) of three coordinates, as AutoCAD's CAL keeps them.
Properties and fields
IsInteger
@property
def IsInteger(self) -> bool
Gets whether the value is a whole number, as 1+2*3 is.
IsVector
@property
def IsVector(self) -> bool
Gets whether the value is a vector.
Number
@property
def Number(self) -> float
Gets the number; the X of a vector.
Point
@property
def Point(self) -> GeoPoint3
Gets the vector as a point; a number gives (number, 0, 0).
X
@property
def X(self) -> float
Gets the number, or the X of a vector.
Y
@property
def Y(self) -> float
Gets the Y of a vector; nought for a number.
Z
@property
def Z(self) -> float
Gets the Z of a vector; nought for a number.
Methods
Integer
@staticmethod
def Integer(value: int) -> CadCalcValue
Makes a whole number.
Real
@staticmethod
def Real(value: float) -> CadCalcValue
Makes a real number.
ToInput
def ToInput(self) -> str
Writes the value as QuickCalc puts it into its input, which CAL reads back: 7, 1.41421, [1,2,0].
ToString
def ToString(self) -> str
Writes the value as AutoCAD 2021's CAL writes it on the command line, whatever the drawing's units: a whole number as 7, a real number to nine significant digits (6, 0.333333333, 53.1301024, 1e+10), a vector as 120,80,0.
ToTyped
def ToTyped(self) -> str
Writes the value as the text AutoCAD types into the prompt a transparent CAL answers: the number, or x,y,z, to every digit it holds.
Vector
@staticmethod
def Vector(x: float, y: float, z: float) -> CadCalcValue
Makes a vector.