Hi,
You can try this code taken from this post and modified for your needs:
https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/save-as-step-using-ilogic/td-p/57671...
Sub Main()
Dim Name As String = InputBox("Enter name", "Name", "Default Name") 'Get the name
Dim Location As String = ThisDoc.Path 'Get the location
' Get the STEP translator Add-In.
Dim oSTEPTranslator As TranslatorAddIn = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
If oSTEPTranslator Is Nothing Then
MessageBox.Show( "Could not access STEP translator.")
Exit Sub
End If
Dim oContext As TranslationContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
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") = ""
oContext.Type = kFileBrowseIOMechanism
Dim oData As DataMedium = ThisApplication.TransientObjects.CreateDataMedium
oData.FileName = Location & "\" & Name & ".stp" ' Create File name
Call oSTEPTranslator.SaveCopyAs(ThisApplication.ActiveDocument, oContext, oOptions, oData)
End If
End Sub
Hope this will help you.
Vincent