Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
HideoYamada
in reply to: Cadkunde.nl

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

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp