I am open and close all drawing in an Assambly with I logic ...my problem is that for some reason it does not close them all.. is there a way to make it better at this ? or better jet ... make it close them before open the next drawing ..
I use oDraw.Close but it fail to close some of them
I use
oDoc.Close(True)
to close (1) drawing at a time, but rarely have multiple drawings open, so I don't know the code to close multiple open drawings.
If you want to close all documents, even not visible you can use
Dim oApp As Application: Set oApp = Inventor.ThisApplication oApp.Documents.CloseAll
If you want to close only drawing type files you need to cycle through all open documents and close only the drawings
Something Like
Sub CloseAllDrawings() Dim oApp As Application: Set oApp = Inventor.ThisApplication Dim oDoc As Document For Each oDoc In oApp.Documents If oDoc.DocumentType = kDrawingDocumentObject Then oDoc.Close Next End Sub
Here is ilogic version. If autodesk would make a ide that could actually help one write ilogic code without relying on visual studio, it would be much appreciated.
For Each oDoc In ThisApplication.Documents If oDoc.DocumentType = kDrawingDocumentObject Then oDoc.Close Next
Can't find what you're looking for? Ask the community or share your knowledge.