Jump to content

woutervddn

Recommended Posts

hi, I'm working on a program that should make some work at the office run autonomous. People will be able to ask for drawings and get a general idea of the price of their product.

 

To let it all go automatic I used the AutoEdit() command. So when I now open the drawing it updates everything makes the drawing fit the screen, pauses the program (so the drawing has time to adjust), and prints it as a pdf.

 

so after the update this is the code:

 

'change zoom

ThisApplication.ActiveView.Fit

 

'pause the program

Dim Finish As Single

Finish = Timer + 5

DoEvents

Do Until Timer >= Finish

Loop

 

'create pdf

ThisDocument.PrintManager.SubmitPrint

 

The programs runs great and everything works. BUT, since everything must go automatically I don't want to press the drawing. when user click send on the online form the drawing must do everything by itself. To do so I've made a VB program which does this:

 

'open inventor

Dim InvTmp As Inventor.Application

InvTmp = CType(CreateObject("Inventor.Application"), Inventor.Application)

 

'open the document

InvTmp.Documents.Open("C:\Users\Wouter\Desktop\T&A\My Dropbox\knowledge base\Fase 3\html to inventor\nozzle.ipt", True)

 

And for some reason this goes wrong. when the document is open and starts the AutoEdit(), VBA tells me that Timer has an runtime-6 error overflow.

 

I can't find the source of this. everthing works when I click the drawing but I can't get it automated because of this. I can't drop the pause cause else the zoom wouldn't be changed by the time the printing starts (with a half drawing as a result)

 

any ideas about how to fix this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...