Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to export a assembly as STP file and Zip it in a windows folder, i have to the following code
Dim StepName As String = Bestandsnaam 'Filename originating from text paramater inside my assembly
Dim SavePath As String = "C:\Data\Configurator testomgeving\Motor generator output files\"
Dim TempFile As String = SavePath & "zipDir\" & StepName & ".stp" 'Temp directory file
If System.IO.File.Exists(TempFile) = True 'check if it already exists
System.IO.File.Delete(TempFile)
End If
ThisDoc.Document.SaveAs(TempFile, True) 'Create Stepfile in a temporary folder in the destination path, it crashes here
Dim ZipName As String = SavePath & StepName & ".zip" 'Zip directory name and location
System.IO.Compression.ZipFile.CreateFromDirectory(SavePath & "zipDir", ZipName) 'Create zip-archive from temporary folder
System.IO.Directory.Delete(SavePath & "zipDir", True) 'Delete temporary folder
Unfortunatly it crashes my Inventor application at ThisDoc.Document.SaveAs(), not sure why....
EDIT: Also my other rule in which i save documents using ThisDoc.Document.SaveAs() has stopped working.
I ran fine earlier this morning, now it closes the application with and gives the 'send crash report' pop-up.
Solved! Go to Solution.