Inventor General Discussion

Inventor General Discussion

Reply
Valued Mentor
pball
Posts: 268
Registered: ‎04-20-2012
Message 1 of 6 (695 Views)

Print drawings from a VBA script

695 Views, 5 Replies
05-11-2012 05:50 AM

I've searched for this a bit and didn't find anything that helped me much. So I'm mostly wondering how possible it is to print drawings using a VBA script. I'm interested in forcing print size and the best fit setting.

 

So if anyone has links or some code to share I would most appreciate it. Searching for printing/plotting yields more results about saving to dwg/pdf than printing to paper.

*Expert Elite*
brendan.henderson
Posts: 337
Registered: ‎07-22-2009
Message 2 of 6 (681 Views)

Re: Print drawings from a VBA script

05-13-2012 10:41 PM in reply to: pball

Here is a link to a macro I posted previously. Read the caveats and subsequent posts-it's not perfect but it works.

 

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Printing-all-drawings-of-an-assembly-f...

Brendan Henderson
CAD Manager


New Blog | Old Blog | Google+ | Twitter


Inventor 2014 PDS Premium SP2 Update 2, Vault Professional 2014 Subs Release 1 & Update 1


Please use "Accept as Solution" & give "Kudos" if this response helped you.

Valued Mentor
pball
Posts: 268
Registered: ‎04-20-2012
Message 3 of 6 (676 Views)

Re: Print drawings from a VBA script

05-14-2012 04:39 AM in reply to: brendan.henderson

Thanks I'll take a look at it.

*Expert Elite*
mrattray
Posts: 2,538
Registered: ‎09-13-2011
Message 4 of 6 (673 Views)

Re: Print drawings from a VBA script

05-14-2012 04:48 AM in reply to: pball

I have one I use that's intended to be run from an idw. It prompts asking if you would like to print the current sheet or all sheets and for number of copies, forcing all other settings. I wrote it because Inventor doesn't play well with our document center and the switching between 11x17 and 8.5x11.

Let me know if you want me to post up the code.

Mike (not Matt) Rattray

Valued Mentor
pball
Posts: 268
Registered: ‎04-20-2012
Message 5 of 6 (670 Views)

Re: Print drawings from a VBA script

05-14-2012 04:56 AM in reply to: mrattray
mrattray that would be most appreciated. That's exactlly what I'm looking to do. Well that and throw in a loop to do multiple drawings in a batch.
*Expert Elite*
mrattray
Posts: 2,538
Registered: ‎09-13-2011
Message 6 of 6 (665 Views)

Re: Print drawings from a VBA script

05-14-2012 05:07 AM in reply to: pball

Code attached. Copy/paste the text file contents into your application project and use file/import file to bring in the .frm file. I'm honestly not sure what the frx file is, but Inventor outputs it when I export the form. I use a template level ilogic rule to call the macro.

Mike (not Matt) Rattray

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.