Inventor General Discussion

Inventor General Discussion

Reply
Mentor
pball
Posts: 237
Registered: ‎04-20-2012
Message 1 of 6 (613 Views)

Print drawings from a VBA script

613 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: 284
Registered: ‎07-22-2009
Message 2 of 6 (599 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 1, Vault Professional 2014 Subs Release 1 & Update 1


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

Mentor
pball
Posts: 237
Registered: ‎04-20-2012
Message 3 of 6 (594 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,481
Registered: ‎09-13-2011
Message 4 of 6 (591 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

Mentor
pball
Posts: 237
Registered: ‎04-20-2012
Message 5 of 6 (588 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,481
Registered: ‎09-13-2011
Message 6 of 6 (583 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

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.