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: 

VBA Print Drawing from File

1 REPLY 1
Reply
Message 1 of 2
CAD-e-Shack
450 Views, 1 Reply

VBA Print Drawing from File

Ive written a program in Inventor that finds all the drawings associated with a part/assembly.

 

it is supposed to find and open the selected drawings invisibly but for some reason the print manager wont work unless the drawing is opened and the drawing is active. In order to make the program work I have to open each drawing then close them. every time the user must input for save changes, and checking out (which is not necessary and takes forever).

 

Is there a way I can print without opening the drawing and making it active?

 

in the attached file, Ln 49-63

 

'Activate the selected document
            Set doc = ThisApplication.Documents.Open(Archive, False)

           ' The only way to make it work is to change this value to True. this sends up all sorts of pop up windows.
            Set osheets = doc.Sheets
                For X = 1 To osheets.Count
                size = osheets.item(X).size
                If first = False Then
                    Compare = size
                    first = True
                End If
' on second iteration print the document
                If Y = 2 Then
                    Call printMacro
                    Printed = True
                    'ThisApplication.ActiveDocument.Close True

                ' then I am forced to close it later which isn't a problem, it just takes time.
                    Exit For
                End If

1 REPLY 1
Message 2 of 2

Hi,

 

this is a design limitation, so the document needs to be open to print. This limitation arises from the fact that an invisible document does not have any 'views'. Unfortunately, there are no plans to fix this issue. Sorry for any inconvenience this may cause to you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report