Class CadSystemVariable
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
A system variable, as AutoCAD's: a name SETVAR asks, or typed alone, and the value it reads and sets where the presenter keeps it. One kept in the drawing (LTSCALE, $LTSCALE of the header) is changed as one step of undo, as AutoCAD records a change of the header; one of the app (OSMODE, PICKBOX) is changed at once, with no step. "Enter new value for OSMODE <4133>:" asks a whole number, 32 768 refused with "Requires an integer between 0 and 32767." and asked again; Enter keeps the value. A variable read only says its value, "EXTMIN = 0.0000,0.0000,0.0000 (read only)".
public sealed class CadSystemVariable
- Inheritance
-
CadSystemVariable
- Inherited Members
Properties
- IsInDrawing
Gets whether it is kept in the drawing, so that a change of it is a step of undo and is saved with the drawing.
- IsReadOnly
Gets whether it can only be read, as EXTMIN and DWGNAME.
- Kind
Gets what it holds.
- Name
Gets the name, in capitals: OSMODE.
Methods
- Angle(string, Func<double>, Action<double>)
Makes an angle the app keeps, as SNAPANG: asked "Enter new value for SNAPANG <30>:" in the drawing's angle units (AUNITS, AUPREC), typed in them or given by two points, and kept from nought up to a whole turn, as AutoCAD keeps 400 as 40 and -30 as 330; set at once, no step of undo.
- Distance(string, Func<double>, Action<double>)
Makes a distance the app keeps, of either sign, as POLARDIST: asked "Enter new value for POLARDIST <0.0000>:", shown to four places, typed or given by two points, 0,0 then 3,4 at "Specify second point:" setting 5 as AutoCAD 2021 does; text that is no number refused with AutoCAD's "Requires numeric distance or two points." and asked again; set at once, no step of undo.
- GetValue(CadCommandSession)
Gets the value as SETVAR shows it in its angle brackets: a whole number as 4133, a real to four places as 1.0000 (an angle as 90), a text in quotes as "0", a point as 0.0000,0.0000,0.0000.
- Integer(string, int, int, Func<int>, Action<int>)
Makes a whole number the app keeps, as OSMODE: asked "Enter new value for OSMODE <4133>:", a number outside
leasttomostrefused with AutoCAD's "Requires an integer between 0 and 32767." and asked again; set at once, no step of undo.
- Point(string, Func<GeoPoint2>, Action<GeoPoint2>)
Makes a point the app keeps, as SNAPBASE: asked "Enter new value for SNAPBASE <0.0000,0.0000>:", typed or picked, a number alone the point that far from the last point towards the cursor, as AutoCAD 2021 takes SNAPBASE 5; set at once, no step of undo.
- Point(string, Func<GeoPoint2>, Func<GeoPoint2, bool>)
Makes a point the app keeps that refuses some values, as SNAPUNIT: asked "Enter new value for SNAPUNIT <10.0000,10.0000>:", typed or picked, a number alone the point that far from the last point towards the cursor (GRIDUNIT 5 with the last point at (10, 20) and the cursor at (13, 24) is 13,24, as AutoCAD 2021 takes it), text that is no point refused with "Invalid 2D point." and asked again; a point the take refuses, as 0,5 for a snap spacing, written off with AutoCAD's "Cannot set SNAPUNIT to that value." and not asked again; set at once, no step of undo.
- Real(string, double, Func<double>, Action<double>)
Makes a real number above nought the app keeps, as POLARANG: asked "Enter new value for POLARANG <90>:", shown to as few places as it needs; nought or less refused with "Value must be positive and nonzero.", one above
mostwith "Value must be at most 360.", and asked again; set at once, no step of undo.
- Switch(string, Func<bool>, Action<bool>)
Makes a switch the app keeps, as LWDISPLAY: shown as OFF or ON, asked "Enter new value for LWDISPLAY <OFF>:", 0, 1, ON or OFF taken in either case, anything else refused with AutoCAD's "Requires 0 or 1 only, or option keyword." and asked again; set at once, no step of undo.
- Text(string, Func<string>, Func<string, bool>)
Makes a text the app keeps that may be empty, as POLARADDANG: asked "Enter new value for POLARADDANG, or . for none <"">:", a period for an empty text; one refused written off with AutoCAD's "Cannot set POLARADDANG to that value." and not asked again; set at once, no step of undo.