- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need only save more screenshots (Image) from different sides, unter Name: Model_001, Model_002, Model_003 - Model_XXX
Model = Part or Assembly that is for me FileName
1-click on ilogic rule = 1 new screen shots with with a suffix _001 - XXX, iLogic itself saves other sreenshots under a new name (verify it free suffix)
Something like here on other forum at STEP file (link is forbidden) :
Option Explicit On
Dim m_Doc As Inventor.Document
m_Doc = ThisDoc.Document
' Start of iLogic code *******************************************
Stepfilename = ThisDoc.PathAndFileName(False)
Counter = 0
FileExists = True
'check to see if the file to be exported already exists
Do While FileExists
' Define name of exported file - note a .stp file extension
' Is currently being used. In this example I am exporting a Step file
CurrentFile = Stepfilename & "_V" & Counter & ".stp"
If Dir(CurrentFile) <> "" Then ' The file does exist
Counter += 1
FileExists = True
Else
SaveAs = MessageBox.Show("Export file as '" & CurrentFile & _
"'?", "Cadline iLogic", _
MessageBoxButtons.YesNo, MessageBoxIcon.Question, _
MessageBoxDefaultButton.Button1)
If SaveAs = vbNo Then
Return
Else ' User says continue
FileExists = False
End If
End If
Loop
' Put your export or 'save as' code in here ***********************
' Get the STEP translator Add-In.
Dim oSTEPTranslator As TranslatorAddIn
oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById _
("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument _
, oContext, oOptions) Then
oOptions.Value("ApplicationProtocolType") = 3
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim oData As DataMedium
oData = ThisApplication.TransientObjects.CreateDataMedium
' Set export name of STEP file
oData.FileName = CurrentFile
oSTEPTranslator.SaveCopyAs(ThisApplication.ActiveDocument, oContext _
, oOptions, oData)
End If
' End of export code ***********************************************
' Ask user if they want to open the export folder
OpenFolder = MessageBox.Show("Export successful! " & _
"- open containing folder now?", "Cadline iLogic", _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question,MessageBoxDefaultButton.Button1)
If OpenFolder = vbYes Then
Process.Start("explorer.exe", ThisDoc.Path)
Else ' User says continue
'Return
End If
' End of iLogic code **************************************************