Is there any way to save the configuration of a "Save Copy As" (to dxf) so that it only saves out the 2nd of a 3-sheet idw? We can click off the "all sheets" and manually choose the 2nd sheet, but that only works for the immediate process. The configuration will not hold the 2nd sheet only choice, defaulting back to the 1st or top sheet only when we do go to 'save out' on subsequent documents.
Thanks in advance,
Don - Inventor 2014
Using the Sheet.DataIO.WriteDataToFile() on the individual sheet might be the way to go for dxf.
Try this one it will let you choose which sheet you want to save as dxf
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oDXFAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
'Define the drawing
Dim oDrawing As DrawingDocument
oDrawing = ThisDoc.Document
Dim oSheet As Sheet
Dim lPos As Long
Dim rPos As Long
Dim sLen As Long
Dim sSheetName As String
Dim sSheetNumber As Integer
'step through each drawing sheet
Dim Response As MsgboxResult
For Each oSheet In oDrawing.Sheets
Response = MsgBox("Yes = Save or No = Continue to next Sheet?", MsgBoxStyle.YesNo, "Question")
If Response = MsgBoxResult.Yes Then
'find the seperator in the sheet name:number
lPos = InStr(oSheet.Name, ":")
'find the number of characters in the sheet name
sLen = Len(oSheet.Name)
'find the sheet name
sSheetName = Left(oSheet.Name, lPos - 1)
'find the sheet number
sSheetNumber = Right(oSheet.Name, sLen - lPos)
ActiveSheet = ThisDrawing.Sheet(oSheet.Name)
'get DXF target folder path
oFolder = "C:\INVENTOR DXF FILES"
'Set the DXF target file name
oDataMedium.FileName = oFolder & "\" & sSheetName & sSheetNumber & ".dxf"
MessageBox.Show("DXF SAVED TO: " & oDataMedium.FileName, "DXF Saved", MessageBoxButtons.OK)
'Publish document
oDXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
End If
Next