cancel
Showing results for 
Search instead for 
Did you mean: 

API to Toggle View Roll-through in Femap v11.3

Siemens Phenom Siemens Phenom
Siemens Phenom

The API listed below is an example of using the new ViewOrient object added to the Femap API in Femap v11.3.  This API also toggles the perspective viewing on in the active view when roll-through is enabled, and off when roll-through is turned off.

 

The ViewOrient object ID uses the same ID as the active view.  See Section 5.62 of the Femap API rerence manual for ViewOrient object properties and methods.

 

The HTML Clipboard

Sub Main
    Dim App As femap.model
    Set App = feFemap()

    Dim rc As femap.zReturnCode

    'ViewOrient Object
    Dim vo As femap.ViewOrient
    Set vo = App.feViewOrient

    'Active View
    Dim vID As Long
    App.feAppGetActiveView ( vID )

    vo.Get ( vID )
    'ViewOrientation Settings
    If vo.ModelAlwaysInFront = True Then
        'Turn on Roll-through
        vo.RollThru ( )
        vo.Perspective = True
        vo.PerspectiveAngle = 30.0
        App.feAppMessage ( FCM_COMMAND, "Roll Thru Mode Enabled" )
    Else
        'Turn off Roll-through
        vo.ModelAlwaysInFront = True
        vo.Perspective = False
        App.feAppMessage ( FCM_COMMAND, "Roll Thru Mode Disabled" )
    End If

    vo.Put ( vID )
    App.feViewRegenerate ( vID )

End Sub

 

Best Regards,
Chip Fricke
Principal Applications Engineer - Femap Product Development