Class CadPrompt
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
One question a command asks on the command line, as AutoCAD asks it: a message, the keywords offered in square brackets,
each typed by its capital letters, and the default Enter takes in angle brackets, so that
Specify base point or [Displacement] <Displacement>: is a point prompt with the keyword Displacement,
which is also its default.
public sealed class CadPrompt
- Inheritance
-
CadPrompt
- Inherited Members
Properties
- AcceptsText
Gets whether text that is neither a point nor a keyword is taken as an answer of text, as ZOOM takes 2X; false for most prompts.
- AsksPlainAngle
Gets whether the angle asked is taken as typed, counter-clockwise, whatever ANGBASE and ANGDIR are, as the obliquing angle of a text style and the direction -UNITS asks for angle nought are. False for every other prompt.
- AsksTurn
Gets whether the angle asked is an amount turned, as ROTATE's rotation angle, the included angle of an arc and the rotation of INSERT are, and not a direction: an angle typed is then turned the way ANGDIR counts and ANGBASE is left out of it, and a point picked gives its direction counted from ANGBASE, as AutoCAD's own prompts do. With ANGBASE at north and ANGDIR clockwise, 30 typed at ROTATE turns the objects 30 degrees clockwise, where 30 typed for the rotation of a text sets it along the direction 60 degrees counter-clockwise from east. False for a prompt that asks a direction, and for every prompt that asks no angle.
- Band
Gets the band an option of "Select objects:" draws while the prompt asks its next point: the box of Window, Crossing and BOX from its first corner, the line of Fence and the polygon of WPolygon and CPolygon through the points given, each to the cursor. Null for every other prompt.
- BasePoint
Gets the point a rubber band is drawn from and a typed relative point, distance or angle is measured from; null for none.
- Default
Gets the default Enter takes, as shown in angle brackets; null for none. A default that is one of the keywords is that keyword.
- Drag
Gets the block dragged with the cursor while the prompt waits, as INSERT drags it while it asks the insertion point, the scale and the rotation: the canvas draws the block's outlines where the cursor would place it. Null for every other prompt.
- InPlace
Gets the text edited in place on the canvas where the prompt asks for one, as TEXTEDIT and MTEXT ask: the window shows its edit box or the MTEXT editor over the text and answers the prompt with the words when the edit ends, Enter with nothing where it is cancelled; a test answers it as any prompt for text. Null for every other prompt.
- IsWaiting
Gets whether the prompt only waits: a command that works for a program outside the app (a run of a tool) shows it while the work goes on, and it takes no text, point, selection or Enter, only Esc, which ends the command.
- Keywords
Gets the keywords offered, written as AutoCAD writes them, the capital letters being what is typed: "Displacement", "mOde".
- Kind
Gets what the prompt asks for.
- Mark
Gets the point the canvas marks with a cross while the prompt waits, as -ATTEDIT marks the attribute it is editing; null for none.
- Message
Gets the message before the keywords: "Specify base point".
- Preview
Gets what the canvas draws under the cursor while the prompt waits, as AutoCAD 2021 drags the object about to be made: the rectangle RECTANG would make with the cursor as its other corner, the circle CIRCLE would make with the cursor on it, the copies ROTATE would turn by a reference. Null where the prompt draws no more than its rubber band.
- SnapFrom
Gets the point perpendicular and tangent snaps are drawn from where the prompt has no BasePoint, as AutoCAD 2021's dimension commands draw them from the last point given (LASTPOINT) at their first extension line origin, the vertex of an angle and the feature of an ordinate; null for every other prompt. No rubber band is drawn from it, and ortho and polar do not work from it.
- TakesSpaces
Gets whether a space typed is part of the answer: true only for a prompt for text (String, or keywords or a text) that was made one that takes spaces (AllowingSpaces()), as AutoCAD's TEXT and -MTEXT do, or as AutoLISP's
getstringdoes with its first argument. False for every other prompt, a name or a file name among them: a space ends the answer as Enter does and the rest of the line is the next input. The window types a space only where this is true and takes Space as Enter elsewhere, and a script ends the word at a space there.
- Text
Gets the whole text the command line shows:
Specify base point or [Displacement] <Displacement>:; after ">>" for a command run inside another, as 'ZOOM's>>Specify first corner:.
- Tracks
Gets whether the prompt follows the cursor, as REVCLOUD's Freehand follows the crosshairs: the canvas answers it with each point the cursor moves to, and the history keeps none of those answers. False for every other prompt.
Methods
- AllowingSpaces()
Makes the prompt for text one where a space is part of the answer (TakesSpaces), as AutoCAD's own prompt for a line of text does; a prompt made with ForString(string, string) ends at a space until this is called.
- ForAngle(string, GeoPoint2?, IReadOnlyList<string>, string)
Asks for an angle.
- ForDistance(string, GeoPoint2?, IReadOnlyList<string>, string)
Asks for a distance.
- ForEntity(string, IReadOnlyList<string>, string)
Asks for one object: "Select arc or circle:".
- ForInPlaceEdit(string, CadInPlaceEdit)
Asks for the words of a text edited in place (InPlace): a prompt for text the window answers from its editor.
- ForInteger(string, IReadOnlyList<string>, string)
Asks for a whole number.
- ForKeyword(string, IReadOnlyList<string>, string)
Asks for one of a list of keywords: "Erase source objects? [Yes/No] <No>:".
- ForPoint(string, GeoPoint2?, IReadOnlyList<string>, string, bool)
Asks for a point.
- ForSelection(string)
Asks for objects until Enter: "Select objects:".
- ForString(string, string)
Asks for a text. A space ends the answer as Enter does, as AutoCAD's prompts for a name, a file name or an option word do; AllowingSpaces() makes it a prompt for a line of text, as TEXT's "Enter text:".
- ForWaiting(string)
Shows a command at work: the message is the whole text, as
STAIRSPY is working... (Esc to stop), with no colon, and nothing but Esc answers it. The host that holds the command ends the wait from code.
- MatchKeyword(string)
Finds the keyword a typed answer names: the whole keyword or its capital letters, either case, or a longer start of it; "D", "disp" and "Displacement" all name Displacement, and "CL" names CLose where C names Close. An underscore in front is taken off, as AutoCAD takes "_A" for A.
- Shortcut(string)
The capital letters of a keyword, what AutoCAD types it by: D for Displacement, O for mOde, CL for CLose.