CadCalculator
from OpenCAD2D import CadCalculator
class CadCalculator(System.Object) ยท CadCalculator in the .NET reference
The geometry calculator of CAL and QuickCalc, as AutoCAD 2021's: numbers, vectors written [x,y,z] (a missing coordinate nought), + - * / ^ and brackets, the functions sin cos tang asin acos atan (in degrees), ln log exp exp10 sqr sqrt abs round trunc r2d d2r (abs of a vector is its length), the constant pi, of points dist(p1,p2), ang(p1,p2), ang(v), ang(apex,p1,p2), ill(p1,p2,p3,p4), ilp, vec, vec1, nor, dpl, dpp, plt, pld, the conversion cvunit(value,from,to), and what is picked in the drawing: cur a point, rad the radius of a circle or an arc, the snaps end ins int mid cen nea nod qua per tan the point of an object picked, and mee, vee, vee1, dee and ille, which pick the ends of lines (CadCalculator.Inputs), and in a drawing (the overload with a session) getvar(name), the number or point of a system variable, w2u and u2w, between the world and the user coordinate system, rot, and xof, yof, zof, xyof, rxof, ryof and rzof.
Methods
Evaluate
@staticmethod
def Evaluate(
expression: str,
picked: System.Collections.Generic.IReadOnlyList[GeoPoint3] | None = ...,
) -> CadCalcValue
Evaluates an expression whose points cur are given.
@staticmethod
def Evaluate(expression: str, answers: System.Collections.Generic.IReadOnlyList[CadCalcValue]) -> CadCalcValue
Evaluates an expression whose inputs are given.
@staticmethod
def Evaluate(
expression: str,
answers: System.Collections.Generic.IReadOnlyList[CadCalcValue],
session: CadCommandSession,
) -> CadCalcValue
Evaluates an expression whose inputs are given, in a drawing: getvar reads the system variables the session knows, and w2u and u2w change points between the world coordinate system and the session's current user coordinate system.
Inputs
@staticmethod
def Inputs(expression: str) -> System.Collections.Generic.IReadOnlyList[CadCalcInput]
Lists what an expression asks for in the drawing, in the order CAL asks it: dist(end,end) two object snaps, cur a point, rad a radius, vee two END snaps. An expression that is wrong from some place on lists what comes before it.
PointsPicked
@staticmethod
def PointsPicked(expression: str) -> int
Counts the points an expression picks in the drawing: each cur in it, as CAL asks one ">> Enter a point:" for each.