Constructor CadCommand
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
CadCommand(string, Func<CadCommandContext, IEnumerable<CadPrompt>>, bool)
Makes a command.
public CadCommand(string name, Func<CadCommandContext, IEnumerable<CadPrompt>> body, bool usesSelection = false)
Parameters
namestringThe name typed to run it, in capitals as AutoCAD writes them: MOVE.
bodyFunc<CadCommandContext, IEnumerable<CadPrompt>>The body: yields each prompt, reads each answer, makes the edit.
usesSelectionboolWhether it works on objects selected first (MOVE, ERASE), so that a selection made before it is taken instead of asking "Select objects:".
Exceptions
- ArgumentNullException
Thrown when the name or the body is null.
- ArgumentException
Thrown when the name is empty or has a space in it.