I want to save an idw drawing as a dwg but only sheet 3 of a 3 sheet set I found this snippet on the forum but cant get it to print only sheet three any help would be appriciated code is below.
' Get the DWG translator Add-In.
'Dim DWGAddIn As TranslatorAddIn
'DWGAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")
'Set a reference to the active document (the document to be published).
'Dim oDocument As Document
'oDocument = ThisApplication.ActiveDocument
'Dim oContext As TranslationContext
'oContext = ThisApplication.TransientObjects.CreateTranslationContext
'oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
' Create a NameValueMap object Dim oOptions As NameValueMap
'oOptions = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
'Dim oDataMedium As DataMedium
'oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
' Check whether the translator has 'SaveCopyAs' options
'If DWGAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
'Dim strIniFile As String
'strIniFile = "C:\temp\DWGout.ini"
' Create the name-value that specifies the ini file to use.
'oOptions.Value("Export_Acad_IniFile") = strIniFile
'oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
'oOptions.Value("Custom_Begin_Sheet") = 3
'oOptions.Value("Custom_End_Sheet") = 3
'End If
'Set the destination file name
'oDataMedium.FileName = FilePath & "\Thumbnails\" & " UNIT " & iProperties.Value("Project", "Engineer") & ".DWG"
'DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
Solved! Go to Solution.
Solved by jeffrey.sun. Go to Solution.
With the VBA code, inventor supports to export the ACTIVE sheet only. Making the minor change to your code can meet your requirement.
1. Generate an ini file. Uncheck the All Sheets option in the dialog below. Click the Save Configuration ... button to save it as C:\temp\DWGout.ini (This file name is referenced in your code).
2. Prior to running your VBA code, active the sheet3. (It can be done by the VBA code)
3. Run your VBA code to export the active sheet.