Hide Table of Contents
IExportToDWG Method (IPartDoc)

Enables various aspects of a part (sheet metal, faces, loops, annotation views) to be saved to disk as a DXF/DWG file.

.NET Syntax

Visual Basic (Declaration) 
Function IExportToDWG( _
   ByVal FilePath As String, _
   ByVal ModelName As String, _
   ByVal Action As Integer, _
   ByVal ExportToSingleFile As Boolean, _
   ByRef Alignment As Double, _
   ByVal IsXDirFlipped As Boolean, _
   ByVal IsYDirFlipped As Boolean, _
   ByVal SheetMetalOptions As Integer, _
   ByVal ViewsCount As Integer, _
   ByRef Views As String _
) As Boolean
Visual Basic (Usage) 
Dim instance As IPartDoc
Dim FilePath As String
Dim ModelName As String
Dim Action As Integer
Dim ExportToSingleFile As Boolean
Dim Alignment As Double
Dim IsXDirFlipped As Boolean
Dim IsYDirFlipped As Boolean
Dim SheetMetalOptions As Integer
Dim ViewsCount As Integer
Dim Views As String
Dim value As Boolean
value = instance.IExportToDWG(FilePath, ModelName, Action, ExportToSingleFile, Alignment, IsXDirFlipped, IsYDirFlipped, SheetMetalOptions, ViewsCount, Views)
bool IExportToDWG( 
   string FilePath,
   string ModelName,
   int Action,
   bool ExportToSingleFile,
   ref double Alignment,
   bool IsXDirFlipped,
   bool IsYDirFlipped,
   int SheetMetalOptions,
   int ViewsCount,
   ref string Views
bool IExportToDWG( 
&   String^ FilePath,
&   String^ ModelName,
&   int Action,
&   bool ExportToSingleFile,
&   double% Alignment,
&   bool IsXDirFlipped,
&   bool IsYDirFlipped,
&   int SheetMetalOptions,
&   int ViewsCount,
&   String^% Views


Full path to the exported DXF/DWG file
Full path to the active part document

1 - export sheet metal (valid only if active document contains sheet metal)

2 - export selected faces or loops

3 - export annotation views

True to save as one file; false to save in separate files

Array of twelve double values that contain information related to output alignment:

Array[0], Array[1], Array[2] - XYZ coordinates of new origin

Array[3], Array[4], Array[5] - coordinates of new x direction vector

Array[6], Array[7], Array[8] - coordinates of new y direction vector

Array[9], Array[10], Array[11] - coordinates of the vector that is normal to the selected faces or loops

The last three elements of the array are valid only if Action = 2

True to flip the x direction; false otherwise
True to flip the y direction; false otherwise

Bitmask that contains sheet metal export options; valid only if Action = 1:

The bitmask is {7 6 5 4 3 2 1}, where each bit is either 0 or 1 as follows:

Bit #1: 1 to export geometry; 0 to not

Bit #2: 1 to include hidden edges; 0 to not

Bit #3: 1 to export bend lines; 0 to not

Bit #4: 1 to include sketches; 0 to not

Bit #5: 1 to merge coplanar faces; 0 to not

Bit #6: 1 to export library features; 0 to not

Bit #7: 1 to export forming tools; 0 to not


If you want to export flat pattern geometry, bend lines, and sketches, then Bits 1, 3, and 4 are 1, the bitmask is 0001101, and you need to set SheetMetalOptions = 2^0 + 2^2 + 2^3 = 1 + 4 + 8 = 13.

Count of annotation views to export; valid only if Action = 3
Array of annotation view names to export; valid only if Action = 3

Return Value

True if export is successful; false otherwise

See Also


SolidWorks 2010 FCS, Revision Number 18.0

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   IExportToDWG Method (IPartDoc)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2012 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.