Solid Edge Part Type Library
SetActiveMode Method
Description
Set a specific mode as active.
Syntax
Visual Basic
Public Sub SetActiveMode( _
   ByVal pActiveModeUnk As Object _
) 
Parameters
pActiveModeUnk
Example
Imports System.IO
Imports System.Runtime.InteropServices

Module Example
    <STAThread()> _
    Sub Main()
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objPartDocument As SolidEdgePart.PartDocument = Nothing
        Dim objStudyOwner As SolidEdgePart.StudyOwner = Nothing
        Dim objStudy As SolidEdgePart.Study = Nothing
        Dim objModesOwner As SolidEdgePart.ModesOwner = Nothing
        Dim objMode As SolidEdgePart.Mode = Nothing

        Try
            OleMessageFilter.Register()

            ' Connect to Solid Edge
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            objPartDocument = objApplication.ActiveDocument

            objStudyOwner = objPartDocument.StudyOwner
            objStudy = objStudyOwner.Item(1)
            objStudy.GetModesOwner(objModesOwner)

            ' This will give us active mode.
            objStudy.GetMode(objMode)

            objModesOwner.SetActiveMode(objMode)

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        Finally
            OleMessageFilter.Revoke()
        End Try
    End Sub
End Module
See Also

ModesOwner Object  | ModesOwner Members  | Solid Edge ST3 - What's New