Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey there.
I managed to string together a piece of ilogic to generate stepfiles and copy them to a secondary location which runs when I save or close my assembly.
However, it seems to cycle through all subassemblies, while I only want the current assembly (top level) to be generated.
I've cut out the last lines defining locations for the step files. My understanding is that it's tied to "ThisApplication.ActiveDocument", but I'm not sure what the alternative is?
Thanks in advance.
' 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
Dim oData As DataMedium
oData = ThisApplication.TransientObjects.CreateDataMedium
oData.FileName = ThisDoc.PathAndFileName(False) & ".stp"
If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument, oContext, oOptions) Then
' Set application protocol.
' 2 = AP 203 - Configuration Controlled Design
' 3 = AP 214 - Automotive Design
oOptions.Value("ApplicationProtocolType") = 3
' Other options...
'oOptions.Value("Author") = ""
'oOptions.Value("Authorization") = ""
'oOptions.Value("Description") = ""
'oOptions.Value("Organization") = "APMØLLERMÆRSK"
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oSTEPTranslator.SaveCopyAs(ThisApplication.ActiveDocument, oContext, oOptions, oData)
End If
Dim oDocument As Document
oDocument = ThisApplication.ActiveDocument
_______________________________________________________________________________________
Intel Core i9-14900KF
64 GB DDR5 6000 MHz
2TB WD_BLACK
RTX A4000
------------------------------
Inventor 2026 Professional
Intel Core i9-14900KF
64 GB DDR5 6000 MHz
2TB WD_BLACK
RTX A4000
------------------------------
Inventor 2026 Professional
Solved! Go to Solution.