Zoom All

Zoom All

Anonymous
Not applicable
672 Views
4 Replies
Message 1 of 5

Zoom All

Anonymous
Not applicable

I want to do a "Zoom All"

 

In a sub I use

 

Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim window As View
Set window = ThisApplication.ActiveView
window.Fit

 

But I want to do it from a VBA form with IV running.  I thought this might work, but no.

 

Dim oApp As Inventor.Application

Dim window As View

Set window = oApp.ActiveView
window.Fit

 

Any guidance would be appreciated.

 

 

0 Likes
673 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

I had another idea, I used a sub to do the window.Fit then added more code to show my form

 

Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim window As View
Set window = ThisApplication.ActiveView
window.Fit

[the above works fine on it's own]

Load myForm
myForm.Show

 

The extra two lines stop the window.Fit working, but load myForm ready for use???

 

Now I am perplexed!!

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

Try the code in the attached Inventor 2010 part.

Is that what you're trying to do?

 

Mike

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

Yes it is.  Thanks for the assistance!

0 Likes
Message 5 of 5

Anonymous
Not applicable

Just for your interest I've included the zoomAll call to the form activate so it happens smoothly when the form opens.

0 Likes