CadPreview
from OpenCAD2D import CadPreview
class CadPreview(System.Object) ยท CadPreview in the .NET reference
What a prompt draws under the cursor while it waits, as AutoCAD 2021 drags the object a command is about to make: the entities the command would make were a point picked at the cursor the answer, made by the same code that makes them when it is, and the copies of objects it would move, each under a transformation. RECTANG asking its other corner, the cursor at (30, 20) from a first corner at the origin, previews the closed polyline 30 by 20 it makes when (30, 20) is picked.
Properties and fields
Fades
@property
def Fades(self) -> bool
Gets whether CadPreview.Items are pieces the answer takes out of the drawing rather than objects it makes, drawn faded as AutoCAD 2021's TRIM draws the piece under the cursor it would cut away: of a line 150 long crossed at 50, the 50 on the cursor's side. With CadPreview.Shift held at TRIM or EXTEND it is the other command's: TRIM then previews the object extended, not faded, and EXTEND fades the piece a trim takes out.
FadesOriginals
@property
def FadesOriginals(self) -> bool
Gets whether the objects of CadPreview.Handles leave where they stand once the answer is given, so that they are drawn faded there while their copies follow the cursor, as AutoCAD 2021's SCALE and ROTATE draw them; false where they stay, as with the Copy option, or where the preview moves none.
Handles
@property
def Handles(self) -> System.Collections.Generic.IReadOnlyList[str]
Gets the objects whose copies CadPreview.Moves places, in ordinal order; empty where the preview moves none.
Shift
@property
def Shift(self) -> bool
@Shift.setter
def Shift(self, value: bool) -> None
Gets or sets whether Shift is held, which a window sets before it asks for the preview: the answer previewed then carries it (CadInput.Shift), as a pick with Shift held does, so that TRIM previews what EXTEND would do to the object under the cursor and EXTEND what TRIM would.
ShowsBand
@property
def ShowsBand(self) -> bool
Gets whether the rubber band from the prompt's base point is drawn with the preview, as CIRCLE draws its radius to the cursor; false where AutoCAD draws the object alone, as RECTANG draws its rectangle.
Typed
@property
def Typed(self) -> str | None
@Typed.setter
def Typed(self, value: str | None) -> None
Gets or sets the text typed so far at a prompt for a line of text, which a window sets before it asks for the preview: the answer previewed is then that text, so that TEXT at "Enter text" previews the words typed where the line will stand. Null or empty previews nothing there.
Methods
Items
def Items(self, cursor: GeoPoint2) -> System.Collections.Generic.IReadOnlyList[DisplayItem2]
Gets the display items of the entities the command would make were a point picked at the cursor, drawn as they will be once made: their layer, colour and linetype the current ones. Empty where the point makes nothing, as a second corner in line with the first makes no rectangle.
Moves
def Moves(self, cursor: GeoPoint2) -> System.Collections.Generic.IReadOnlyList[Affine2]
Gets the transformations the copies of CadPreview.Handles are drawn under were a point picked at the cursor: one for ROTATE by a reference, one for each copy a rectangular array of 4 columns and 3 rows adds. Empty for none.