Class CadAttachRequest
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
The Attach External Reference and Attach Image dialogs of XATTACH and IMAGEATTACH, as data the command and the window share: the file, its name and path type, and the insertion point, scale and rotation, each given or asked on the command line after OK. Setting FileName reads what the dialog shows of the file: a picture's pixels and size, a drawing's unit.
public sealed class CadAttachRequest
- Inheritance
-
CadAttachRequest
- Inherited Members
Constructors
- CadAttachRequest(CadDocument, CadAttachKind)
Makes the request of a document, as the dialog opens: the point asked, scale 1, no rotation, a relative path.
Properties
- Action
Gets or sets what the window's dialog was closed with; Cancel until set.
- BaseHeight
Gets the height of the picture at scale 1 in the drawing's units, in the measure of its width.
- BaseWidth
Gets the width of the picture at scale 1 in the drawing's units, as AutoCAD 2021 sizes it: its pixels over its resolution where the file gives one and the drawing has a unit (40 pixels of 96 dots an inch are 10.5833 mm), else 1, as AutoCAD sizes a picture of no resolution one unit wide.
- Document
Gets the document attached to.
- Drawing
Gets the drawing read for an external reference, to preview it; null for an image or a file that cannot be read.
- Error
Gets why the file chosen cannot be attached, in AutoCAD's words; null where it can.
- FileName
Gets or sets the full path of the file chosen. Set, the name becomes the file's name without its extension, and the file is read: a picture's pixels and resolution, a drawing's unit; Error says why one cannot be attached.
- HasResolution
Gets whether the picture read gives its resolution, which sizes it in the drawing's unit.
- IsOverlay
Gets or sets whether the drawing is overlaid rather than attached (Reference Type); not for an image.
- IsRelativeFallingBack
Gets whether Relative is asked of a drawing not saved yet, which is written with the full path instead.
- Kind
Gets what is attached.
- Name
Gets or sets the name: of the external reference's block, or of the image definition; the file's name until set.
- PageCount
Gets how many pages the PDF chosen has; nought before one is chosen.
- PathType
Gets or sets how the path is written; Relative until set, as AutoCAD 2021's dialog opens.
- PixelHeight
Gets the pixels up of the picture read; nought before.
- PixelWidth
Gets the pixels across of the picture read; nought before.
- Point
Gets or sets the insertion point where it is not asked.
- Rotation
Gets or sets the rotation where it is not asked, in radians.
- SavedPath
Gets the path written for the file: as PathType says, from the drawing's folder for Relative, the full path while the drawing has no file yet; empty while no file is chosen.
- Scale
Gets or sets the scale along X, Y and Z where it is not asked; 1, 1, 1 until set. An image takes X alone.
- SelectedPages
Gets the pages chosen, by number from 1, in the order they are attached: page 1 once a PDF is chosen, as AutoCAD 2021 selects the first page; the dialog changes the list, a typed -PDFATTACH sets the one page it asks for.
- SpecifyPointOnScreen
Gets or sets whether the insertion point is asked on the command line; true until set.
- SpecifyRotationOnScreen
Gets or sets whether the rotation is asked on the command line.
- SpecifyScaleOnScreen
Gets or sets whether the scale is asked on the command line.
- UniformScale
Gets or sets whether the external reference is scaled alike along every axis (Uniform Scale); true until set.
- UnitFactor
Gets the factor an external reference is scaled by, from its drawing's unit to this drawing's (Factor); 1 for an image.
- Units
Gets the unit: of the drawing read for an external reference (Block Unit), of this drawing for an image.
Methods
- PageHeight(int)
Gets the height of a page of the PDF chosen in inches.
- PageWidth(int)
Gets the width of a page of the PDF chosen in inches, as AutoCAD 2021 measures it (a point is 1/72 of an inch); nought for a page it has not.