As caption, I think the two command should be the same, actually they are different result for the same view:
Any master who can tell the reason?how can I make the visible entity fill just the window using API?
You can read about the difference in the Femap Help. Press "F1" while in a command to quickly open that section of the Help.
Specifically, help section 6.2.4 View, Magnifiy should help clairify this:
"The Fill View button is similar to the View, Autoscale command. It too bases its calculations on the overall model dimensions. However, this button only considers the current orientation of your model. It projects the overall dimensions into the current view and then adjusts the magnification factor to attempt to fill the screen. This will always result in a larger image than View, Autoscale. If your model geometry is non-rectangular, or has cutouts, this option still might not fill the view. Unlike the other View, Magnify options, but just like the View, Autoscale command, the Fill View button will automatically adjust the centering of your model."
You can call autoscale or set the magnification via the API such as:
Sub Main Dim App As femap.model Set App = feFemap() Dim v As View Set v = App.feView Dim viewID As Long App.feAppGetActiveView(viewID) App.feViewAutoscaleAll(viewID,True) v.Get(viewID) v.Magnification = 2 ' v.Put(viewID) App.feViewRegenerate(viewID) End Sub
You'll probably want "feViewAutoscaleVisible()"
Sub Main Dim App As femap.model Set App = feFemap() Dim viewID As Long App.feAppGetActiveView(viewID) App.feViewAutoscaleVisible(viewID,True) App.feViewRegenerate(viewID) End Sub