Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have some drawings open in my inventor session.
I'd to run a macro saved in one file called "rule".dwg
macro simply gets the file name, display it with message box
and then close the "processed" file if it is not the "rule" one.
At th end only "rule" drawing will remain open.
I have some proble with close command line
oDocument.Close does nothing.
ThisApplication.Document.close returns error
Thanks for helping
' Declaration Dim oDocument As DrawingDocument ' Starting cycle For Each oDocument In ThisApplication.Documents.VisibleDocuments ' Get file name Dim myoutputname As String myoutputname = System.IO.Path.GetFileNameWithoutExtension(oDocument.FullFileName) 'Code If myoutputname <> "rule" Then MessageBox.Show(myoutputname, "Title") 'oDocument.Close'???????? Else MessageBox.Show("This file contains the rule", "Title") End If 'end for each cycle Next
Solved! Go to Solution.