Message 1 of 2
iLogic idw to dwg fatal error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've written this iLogic that will convert any open IDW to a DWG file.
Problem is when run this rule and have 15+ files open, it crashes half way thru.
Not sure why and I don't get any messages, just the Autodesk has crashed send in the report message.
Below is the code... anyone have any ideas?
Dim oDoc As Document For Each oDoc In ThisApplication.Documents.VisibleDocuments If oDoc Is Nothing Then MsgBox("Missing Inventor Document") Exit Sub End If Try Dim ThisApp = ThisApplication Dim TransObj As TransientObjects = ThisApp.TransientObjects If oDoc.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then MessageBox.Show("This Rule must be run from within a Drawing Document.", "Incorrect Document Type") Exit Sub End If Catch MessageBox.Show("Error Getting Document Information" & vbCr & "Is the current Document Saved?", "Document Error") End Try oFileName = System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName) 'without extension 'MessageBox.Show(oFileName, "Title") oDoc.SaveAs(System.IO.Path.ChangeExtension(oDoc.FullFileName, ".dwg") , True) 'MessageBox.Show(oFileName & ".dwg Saved!! " & vbCrLf & vbCrLf & ThisDoc.Path , "Save As") oDoc.Activate Next