SapObject.SapModel.View.RefreshView
Function RefreshView(Optional ByVal Window As Long = 0, Optional Zoom As Boolean = True) As Long
Window
This is 0 meaning all windows or an existing window number. It indicates the window(s) to have its view refreshed.
Zoom
If this item is True, the window zoom is maintained when the view is refreshed. If it is False, the zoom returns to a default zoom.
This function refreshes the view for the specified window(s). It returns zero if the window views are successfully refreshed, otherwise it returns a nonzero value.
See RefreshWindow and RefreshView for more information.
Sub RefreshAllViews()
'dimension variables
Dim SapObject As Sap2000.SapObject
Dim SapModel As cSapModel
Dim ret As Long
Dim Name As String
'create Sap2000 object
Set SapObject = New SAP2000.SapObject
'start Sap2000 application
SapObject.ApplicationStart
'create SapModel object
Set SapModel = SapObject.SapModel
'initialize model
ret = SapModel.InitializeNewModel
'create model from template
ret = SapModel.File.New2DFrame(PortalFrame,
3, 124, 3, 200)
'add a frame object
ret = SapModel.FrameObj.AddByPoint("1",
"6", Name)
'refresh view for all windows
ret = SapModel.View.RefreshView
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Initial release in version 11.00.