Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fail to close drawing using ilogic.. how do it make it close them all ?

3 REPLIES 3
Reply
Message 1 of 4
Darkforce_the_ilogic_guy
357 Views, 3 Replies

fail to close drawing using ilogic.. how do it make it close them all ?

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

Tags (1)
3 REPLIES 3
Message 2 of 4

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.


---------------------------------------------------
It's not easy maintaining this level of insanity !!!!!
Message 3 of 4

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

 

Message 4 of 4
cshunt
in reply to: cshunt

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.

Post to forums  

Technology Administrators


Autodesk Design & Make Report