Code for change of view

Hello

I'm looking for the code to change the document view so that it goes to "zoom all" when changing on the part.

The reason: I have an assembly with a lot of parts I hide and make others reappear (by code and form), but my screen is no longer centered on the part at all, I would like to add this line of code but impossible to find in the help, or even online.

I don't think many people use the Vb tool on Inventor, or they are much more qualified and don't need help.

Thank you in advance.

Hello

It is the instruction:

ThisApplication.ActiveView.Fit True

Remark:

Inventor must be the active window, it is not possible to use this statement with breakpoints in the VBA.

One note - for this to work, Inventor must be the active window, not the VBA or other programming interface. In other words, you need to initiate it from Inventor via a macro and you can't have any break point set in the code.
 

 

Thank you very much.

Quick question again where did you find this order?

1 Like

On the AutoDesk forum ;-) 

If this solves the problem, please choose my answer as the best.