i have been using WriteDataToFile to export an ACIS SAT file but, unfortunately, this function does not support Parasolid. Is there an alternate way for me to export a Parasolid file in lieu of using WriteDataToFile?
thanks
Hello,
I don't know if you still need this, but you can use an Inventor Translation AddIn to export a Parasolid file.
Hope it will help you out!
Public Sub CreateX_T() 'This TranslatorAddIn will export a *.X_T file, you can try searching in the VBA object browser for other AddIns Dim X_TAddIn As TranslatorAddIn Set X_TAddIn = ThisApplication.ApplicationAddIns.ItemById("{8F9D3571-3CB8-42F7-8AFF-2DB2779C8465}") 'Set a reference to the active document (the document to be published). Dim oDoc As Document Set oDoc = ThisApplication.ActiveDocument
Dim oContext As TranslationContext Set oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = kFileBrowseIOMechanism 'Create a NameValueMap object Dim oOptions As NameValueMap Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap 'Create a DataMedium object Dim oDataMedium As DataMedium Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium 'FullFileName of exported file oDataMedium.FileName = "c:\temptest.x_t" 'Publish document. Call X_TAddIn.SaveCopyAs(oDoc, oContext, oOptions, oDataMedium) End Sub
With some changes, the code works great. Is it possible to add the option to define the version? Inventor 2020 will choose version 31. Some clients, such as those using previous versions of SolidWorks cannot open a version 31 file, so a previous version must be selected.
TIA
Hello,
It seems like I was able to find a solution to your problem: just add a highlighted code to your program. You can replace number 11 with the version that works for you. Inventor 2016 supports versions from 9 to 27.
Public Sub CreateX_T() 'This TranslatorAddIn will export a *.X_T file, you can try searching in the VBA object browser for other AddIns Dim X_TAddIn As TranslatorAddIn Set X_TAddIn = ThisApplication.ApplicationAddIns.ItemById("{8F9D3571-3CB8-42F7-8AFF-2DB2779C8465}") 'Set a reference to the active document (the document to be published). Dim oDoc As Document Set oDoc = ThisApplication.ActiveDocument Dim oContext As TranslationContext Set oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = kFileBrowseIOMechanism 'Create a NameValueMap object Dim oOptions As NameValueMap Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap 'Create a DataMedium object Dim oDataMedium As DataMedium Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium ' Check whether the translator has 'SaveCopyAs' options If X_TAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
' Options for files... oOptions.Value("Version") = 11 ' Export file version: from 9 to 27
End If 'FullFileName of exported file oDataMedium.FileName = "c:\temptest.x_t" 'Publish document. Call X_TAddIn.SaveCopyAs(oDoc, oContext, oOptions, oDataMedium) End Sub
Hope this helps!
Can't find what you're looking for? Ask the community or share your knowledge.