Solid Edge Framework Type Library
StartCommand Method
Solid Edge Framework Type Library > Application Object : StartCommand Method

A constant that specifies the ID of the Solid Edge command to start. The constant can be a member of:

Any constant from any of these sets is valid, as long as the environment to which the constant set belongs is active.

Description
Activates a specified Solid Edge command.
Syntax
Visual Basic
Public Sub StartCommand( _
   ByVal CommandID As SolidEdgeCommandConstants _
) 
Parameters
CommandID
ValueDescription
seAssemblyPlacePartCommandPlace Part command
seAssemblySelectCommandSelect command
seConvertCommand
seDraftSelectCommandDraft Select command
sePartInsertPartCommandInsert Part command
sePartSelectCommandPart Select command
seRefreshViewCommandRefresh View Command
seSheetMetalSelectCommandSheetMetal Select command
seSurfaceVisualCommandSurface Visual Command

A constant that specifies the ID of the Solid Edge command to start. The constant can be a member of:

Any constant from any of these sets is valid, as long as the environment to which the constant set belongs is active.

Example
Imports System
Imports System.Runtime.InteropServices

Namespace Examples
    Friend Class Program
        <STAThread>
        Shared Sub Main(ByVal args() As String)
            Dim application As SolidEdgeFramework.Application = Nothing

            Try
                ' See "Handling 'Application is Busy' and 'Call was Rejected By Callee' errors" topic.
                OleMessageFilter.Register()

                ' Attempt to connect to a running instance of Solid Edge.
                application = DirectCast(Marshal.GetActiveObject("SolidEdge.Application"), SolidEdgeFramework.Application)

                application.StartCommand(SolidEdgeFramework.SolidEdgeCommandConstants.sePartSelectCommand)
            Catch ex As System.Exception
                Console.WriteLine(ex)
            Finally
                OleMessageFilter.Unregister()
            End Try
        End Sub
    End Class
End Namespace
using System;
using System.Runtime.InteropServices;

namespace Examples
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            SolidEdgeFramework.Application application = null;

            try
            {
                // See "Handling 'Application is Busy' and 'Call was Rejected By Callee' errors" topic.
                OleMessageFilter.Register();

                // Attempt to connect to a running instance of Solid Edge.
                application = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");

                application.StartCommand(SolidEdgeFramework.SolidEdgeCommandConstants.sePartSelectCommand);
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                OleMessageFilter.Unregister();
            }
        }
    }
}
See Also

Application Object  | Application Members