GetID Method (IUserCommand)

GetID Method (IUserCommand) | Send Feedback
See Also Example

UserCmdID[out]
  User command's ID (see Remarks)

Gets the user command's ID.

# Syntax

Visual Basic |
--- | ---
    Function GetID() As System.String

C# |
--- | ---
    System.string GetID()

JavaScript |
--- | ---
    GetID() : String

COM native C++ |
--- | ---
    HRESULT GetID(
       BSTR* UserCmdID
    )

C++ |
--- | ---
    DSRESULT GetID(
       dsString* UserCmdID
    )

#### Parameters

UserCmdID[out] or Return Value
  User command's ID (see Remarks)

# Example

This code snippet shows how to get the user command's ID (from the DraftSight API COM native C++ template files DsAddinUserCommand.h and DsAddinUserCommand.cpp).

#### COM native C++

DsAddinUserCommand.h

> bstr_t GetUserCommandID();

DsAddinUserCommand.cpp

> bstr_t DsAddinUserCommand::GetUserCommandID()
> {
> return m_DsUserCommand->GetID();
> }

# Example

Create Context-sensitive Menu Items (C#)
Create Context-sensitive Menu Items (VB.NET)
Create Context-sensitive Menu Items (VBA)

# Remarks

The return value is the string specified for IMenuItem::InsertMenuItem's or IToolBar::InsertToolBarItem's UserCmdID parameter.

# See Also

####

IUserCommand Interface
IUserCommand Members

# Availability

DraftSight V1R1