I use microstation 08.11.09.578, DGN 2D V7 Upgrade V8
I want to click the FITVIEW button
... MicroStationDGN.View v = app.ActiveDesignFile.Views[1]; v.Fit(true);
I tried this code but no successIs there any method to call the function 'FITVIEW' or similar
Hi,
ba ranh said:I want to click the FITVIEW button
No, you do not want. Or, if you really want to "click the button", your code is wrong.
Do not mix MicroStation GUI and MicroStation API (regardless VBA/COM or native). MicroStation tools are typically represented by key-ins (and further by icons/button in some cases), calling internally the same API as yours.
So to "click the button" lead to call proper key-in (probably something like "fit view extended 1", whereas to "use API to fit a view" lead to new code, implementing the same functionality.
ba ranh said:I tried this code but no success
What does it mean? "No success" is pretty subjective and tells nothing. Be developer, be detailed and accurate.
ba ranh said:I tried this code
Did you read API documentation? What I see in VBA Fit method description:
Fit does not redraw the view. To show the change in the view, call the View.Redraw method.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Mr Jan
View.Redraw method doesn't work like FitView buttonIs it possible to do the same thing as FitView
ba ranh said:View.Redraw method doesn't work like FitView button
I do not understand. Did I wrote anything like "Redraw is / works like FitView button"? No.
Based on what you comment you made such conclusion?
ba ranh said:Is it possible to do the same thing as FitView
You do not answer my question (whether you read the documentation), because it seems you did not.
Yes, use Fit method, it works fine. But read the method documentation and understand it at first, and write the code accordingly (which requires to use Fit and redraw the view).
Regards,
Jan Šlegr said:which requires to use Fit and redraw the view
Thank Jan, I made it