Zoom All

Zoom All

Anonymous
不适用
679 次查看
4 条回复
1 条消息(共 5 条)

Zoom All

Anonymous
不适用

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 个赞
680 次查看
4 条回复
回复 (4)
2 条消息(共 5 条)

Anonymous
不适用

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 个赞
3 条消息(共 5 条)

Anonymous
不适用

Try the code in the attached Inventor 2010 part.

Is that what you're trying to do?

 

Mike

 

0 个赞
4 条消息(共 5 条)

Anonymous
不适用

Yes it is.  Thanks for the assistance!

0 个赞
5 条消息(共 5 条)

Anonymous
不适用

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

0 个赞