Inventor General Discussion

Inventor General Discussion

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

Print drawings from a VBA script

662 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: 322
Registered: ‎07-22-2009
Message 2 of 6 (648 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: 261
Registered: ‎04-20-2012
Message 3 of 6 (643 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,517
Registered: ‎09-13-2011
Message 4 of 6 (640 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: 261
Registered: ‎04-20-2012
Message 5 of 6 (637 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,517
Registered: ‎09-13-2011
Message 6 of 6 (632 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
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!