Table of Contents

Method Switch

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

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.

public static CadSystemVariable Switch(string name, Func<bool> get, Action<bool> set)

Parameters

name string

The name.

get Func<bool>

Reads the value.

set Action<bool>

Sets a value taken.

Returns

CadSystemVariable

The variable.

Exceptions

ArgumentNullException

Thrown when either delegate is null.

ArgumentException

Thrown when the name is empty or has a space.