10-01-2019
07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-01-2019
07:09 AM
Hello,
@Cadkunde.nl wrote:The application is already running invisible. Inventor crashes when too much in memory. Try make a program that opens a large number of inventor drawings and export them to autocad dwg's
that does not crash if you don't believe me.
I made and run this VBA macro which saves the files in "<WorkSpace>\IDW" as AutoCAD dwg, and got the 241 dwg files (77MB) in about 30 minuits.
The largest assembly consists of 1,031 files and 10,518 occurrences.
Option Explicit
Sub test()
Dim idwDirctoryPath As String
Dim idwFilename As String
Dim idwFullPath As String
Dim oDrawingDoc As DrawingDocument
idwDirctoryPath = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath & "\IDW\"
Debug.Print idwDirctoryPath
Debug.Print "START : " & Now()
idwFilename = Dir(idwDirctoryPath & "*.idw")
Do While idwFilename <> ""
idwFullPath = idwDirctoryPath & idwFilename
Debug.Print idwFullPath
Set oDrawingDoc = ThisApplication.Documents.Open(idwFullPath)
oDrawingDoc.SaveAs Left(idwFullPath, Len(idwFullPath) - 3) & "dwg", True
oDrawingDoc.Dirty = False
ThisApplication.SilentOperation = True
oDrawingDoc.Close
ThisApplication.SilentOperation = False
idwFilename = Dir()
Loop
Debug.Print "END : " & Now()
End Sub
======
Freeradical
Hideo Yamada