Class CadCalculator
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
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 (Inputs(string)), 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.
public static class CadCalculator
- Inheritance
-
CadCalculator
- Inherited Members
Remarks
1+2*3 is 7, sqrt(16)+2 6, dist([0,0],[300,400]) 500, ang([0,0],[300,400]) 53.1301024 and
[100,50]+[20,30] 120,80,0, as CAL writes them (ToString()). A number added to a vector is
refused as AutoCAD refuses it: "Operators '+', '-' require operands of the same type".
Methods
- Evaluate(string, IReadOnlyList<GeoPoint3>)
Evaluates an expression whose points
curare given.
- Evaluate(string, IReadOnlyList<CadCalcValue>)
Evaluates an expression whose inputs are given.
- Evaluate(string, IReadOnlyList<CadCalcValue>, CadCommandSession)
Evaluates an expression whose inputs are given, in a drawing:
getvarreads the system variables the session knows, andw2uandu2wchange points between the world coordinate system and the session's current user coordinate system.
- Inputs(string)
Lists what an expression asks for in the drawing, in the order CAL asks it:
dist(end,end)two object snaps,cura point,rada radius,veetwo END snaps. An expression that is wrong from some place on lists what comes before it.
- PointsPicked(string)
Counts the points an expression picks in the drawing: each
curin it, as CAL asks one ">> Enter a point:" for each.