v2.50
IDrawing Interface Reference

Represents an architectural drawing. This interface can be obtained as an additional interface from IEntity if the entity is a drawing. More...

Public Member Functions

HRESULT CreateDwgDxfExportSettings ([out, retval] IDwgDxfExportSettings **ppDwgDxfExportSettings)
 Creates the instance of DWG/DXF export settings.
HRESULT ExportToDwg ([in] BSTR filePath, [in] enum AutocadVersion autocadVersion, [in] VARIANT_BOOL overwrite, [out, retval] int *pResult)
 Exports the drawing to DWG file format.
HRESULT ExportToDwg2 ([in] BSTR filePath, [in] enum AutocadVersion autocadVersion, [in] IDwgDxfExportSettings *pDwgDxfExportSettings, [in] VARIANT_BOOL overwrite, [out, retval] int *pResult)
 Exports the drawing to DWG file format.
HRESULT ExportToDxf ([in] BSTR filePath, [in] enum AutocadVersion autocadVersion, [in] VARIANT_BOOL overwrite, [out, retval] int *pResult)
 Exports the drawing to DXF file format.
HRESULT ExportToDxf2 ([in] BSTR filePath, [in] enum AutocadVersion autocadVersion, [in] IDwgDxfExportSettings *pDwgDxfExportSettings, [in] VARIANT_BOOL overwrite, [out, retval] int *pResult)
 Exports the drawing to DXF file format.
HRESULT ExportToOpenXps ([in] BSTR filePath, [in] VARIANT_BOOL overwrite, [out, retval] int *pResult)
 Exports the drawing to OpenXPS file format.
HRESULT ExportToPdf ([in] BSTR filePath, [in] VARIANT_BOOL overwrite, [out, retval] int *pResult)
 Exports the drawing to PDF file format.
HRESULT GetTitleBlockInstance ([in] int index, [out, retval] ITitleBlockInstance **ppTitleBlockInstance)
 Returns the drawing title block instance by index.
HRESULT GetTransformFromEmbeddedModelView ([in] int embeddedModelViewId, [in] int viewPartIndex, [out, retval] ITransform3D **transform)
 Returns the transformation matrix that maps points from the drawing coordinate system into the building model coordinate system according to the given emebedded model view. The matrix transforms 3D points: the input point should contain drawing coordinates in X and Y, while Z must be set to 0 (because drawings are 2D).

Properties

GUID Id [get]
 The Id of the drawing.
BSTR IdS [get]
 The Id of the drawing as a string.
BSTR Name [get]
 The name of the drawing.
int TitleBlockInstanceCount [get]
 The drawing title block instance count.

Detailed Description

Represents an architectural drawing. This interface can be obtained as an additional interface from IEntity if the entity is a drawing.

Allows the user to export a drawing to the DXF and DWG file formats.

Member Function Documentation

◆ ExportToDwg()

HRESULT ExportToDwg ( [in] BSTR filePath,
[in] enum AutocadVersion autocadVersion,
[in] VARIANT_BOOL overwrite,
[out, retval] int * pResult )

Exports the drawing to DWG file format.

Parameters
[in]filePathThe file path of file to export.
[in]autocadVersionThe AutoCAD format version to target for.
[in]overwriteOverwrite the file if it exists
[out]pResultOperation result.
Returns
Zero if the drawing was successfully exported, non-zero otherwise.
See also
ExportToDwg2

◆ ExportToDwg2()

HRESULT ExportToDwg2 ( [in] BSTR filePath,
[in] enum AutocadVersion autocadVersion,
[in] IDwgDxfExportSettings * pDwgDxfExportSettings,
[in] VARIANT_BOOL overwrite,
[out, retval] int * pResult )

Exports the drawing to DWG file format.

Parameters
[in]filePathThe file path of file to export.
[in]autocadVersionThe AutoCAD format version to target for.
[in]overwriteOverwrite the file if it exists
[in]pDwgDxfExportSettingsThe DWG/DXF export settings.
[out]pResultOperation result.
Returns
Zero if the drawing was successfully exported, non-zero otherwise.

◆ ExportToDxf()

HRESULT ExportToDxf ( [in] BSTR filePath,
[in] enum AutocadVersion autocadVersion,
[in] VARIANT_BOOL overwrite,
[out, retval] int * pResult )

Exports the drawing to DXF file format.

Parameters
[in]filePathThe file path of file to export.
[in]autocadVersionThe AutoCAD format version to target for.
[in]overwriteOverwrite the file if it exists.
[out]pResultOperation result.
Returns
Zero if the drawing was successfully exported, non-zero otherwise.
See also
ExportToDxf2

◆ ExportToDxf2()

HRESULT ExportToDxf2 ( [in] BSTR filePath,
[in] enum AutocadVersion autocadVersion,
[in] IDwgDxfExportSettings * pDwgDxfExportSettings,
[in] VARIANT_BOOL overwrite,
[out, retval] int * pResult )

Exports the drawing to DXF file format.

Parameters
[in]filePathThe file path of file to export.
[in]autocadVersionThe AutoCAD format version to target for.
[in]overwriteOverwrite the file if it exists.
[in]pDwgDxfExportSettingsThe DWG/DXF export settings.
[out]pResultOperation result.
Returns
Zero if the drawing was successfully exported, non-zero otherwise.

◆ ExportToOpenXps()

HRESULT ExportToOpenXps ( [in] BSTR filePath,
[in] VARIANT_BOOL overwrite,
[out, retval] int * pResult )

Exports the drawing to OpenXPS file format.

Parameters
[in]filePathThe result file path.
[in]overwriteOverwrite the file if it exists.
[out]pResultOperation result.
Returns
Zero if the drawing was successfully exported, non-zero otherwise.

◆ ExportToPdf()

HRESULT ExportToPdf ( [in] BSTR filePath,
[in] VARIANT_BOOL overwrite,
[out, retval] int * pResult )

Exports the drawing to PDF file format.

Parameters
[in]filePathThe result file path.
[in]overwriteOverwrite the file if it exists.
[out]pResultOperation result.
Returns
Zero if the drawing was successfully exported, non-zero otherwise.

◆ GetTransformFromEmbeddedModelView()

HRESULT GetTransformFromEmbeddedModelView ( [in] int embeddedModelViewId,
[in] int viewPartIndex,
[out, retval] ITransform3D ** transform )

Returns the transformation matrix that maps points from the drawing coordinate system into the building model coordinate system according to the given emebedded model view. The matrix transforms 3D points: the input point should contain drawing coordinates in X and Y, while Z must be set to 0 (because drawings are 2D).

Parameters
[in]embeddedModelViewIdThe Id of embedded model view object
[in]viewPartIndexThe zero-based index of view part for which the transform will be obtained. This parameter only makes sense for embedded section views which were formed by section with multiple planes. For one-plane section view and for other embedded model views this parameter should be equal 0.
[out]transformThe resulting transformation matrix.

See an example of using this method below:

var drawing = project.Drawings2.GetByIndex(0) as IDrawing;
// ... get id of embedded model view from this drawing as embeddedModelViewId ...
var transform = drawing.GetTransformFromEmbeddedModelView(embeddedModelViewId, 0);
// ... get some 2D point in drawing CS as somePoint ...
var somePoint3D = new Point3D { X = somePoint.X, Y = somePoint.Y, Z = 0 }; // add Z component
var pointInBuildingModel = transform.TransformPoint(somePoint3D); // point in building model CS
Represents an architectural drawing. This interface can be obtained as an additional interface from I...
Definition IDrawing.idl:53
HRESULT GetTransformFromEmbeddedModelView([in] int embeddedModelViewId, [in] int viewPartIndex, [out, retval] ITransform3D **transform)
Returns the transformation matrix that maps points from the drawing coordinate system into the buildi...
Represents a 3D point.
Definition Point.idl:62
See also
ITransform3D::TransformPoint