Welcome
Expand Getting StartedGetting Started
Expand SOLIDWORKS API HelpSOLIDWORKS API Help
Collapse SOLIDWORKS Electrical API HelpSOLIDWORKS Electrical API Help
Expand Getting StartedGetting Started
Expand Release NotesRelease Notes
Collapse ClassesClasses
Expand Class ListClass List
Class Index
Collapse Class HierarchyClass Hierarchy
_DIEwProjectXEvents
Collapse IDispatchIDispatch
IEwAddIn
IEwAPIX
IEwApplicationReactorX
IEwApplicationSettingsX
IEwApplicationX
IEwArchiveEnvironmentX
IEwCableCoreX
IEwCableReferenceManagerX
IEwCableReferenceX
IEwCommandContextX
IEwCommandManagerX
IEwCommandX
IEwDialogAlignPartsParametersSelectorX
IEwDialogLocationSelectorX
IEwDialogMacroSelectorX
IEwDialogManufacturerPartOrderingX
IEwDialogManufacturerPartSelectorX
IEwDialogProgressX
IEwDialogProjectManagerX
IEwDialogResumeX
IEwDialogSummaryX
IEwDialogTaskX
IEwDockingPaneManagerX
IEwDockingPaneX
IEwEnvironmentX
IEwInteropFactoryX
IEwLibraryManagerX
IEwLibraryX
IEwLockStringX
IEwManufacturerPartCircuitX
IEwManufacturerPartManagerX
IEwManufacturerPartTerminalX
IEwManufacturerPartX
Expand IEwObjectBaseXIEwObjectBaseX
IEwPointX
IEwProjectAutomaticArrowsX
IEwProjectBookManagerX
IEwProjectCableManagerX
IEwProjectComponentManagerX
IEwProjectComponentTerminalX
IEwProjectEntity3DManagerX
IEwProjectExcelAutomationX
IEwProjectExportDWGFilesX
IEwProjectExportPDFX
IEwProjectExportPDMX
IEwProjectExportReportX
IEwProjectFileManagerX
IEwProjectFolderManagerX
IEwProjectFunctionManagerX
IEwProjectGenerateTSDrawingX
IEwProjectHarnessManagerX
IEwProjectInputOutputManagerX
IEwProjectLocationManagerX
IEwProjectManagerX
IEwProjectManufacturerPartCircuitX
IEwProjectManufacturerPartManagerX
IEwProjectManufacturerPartTerminalX
IEwProjectManufacturerPartX
IEwProjectNumberDocumentsX
IEwProjectNumberMarksX
IEwProjectNumberWiresX
IEwProjectOptimizeWireOrderX
IEwProjectPrintConfigManagerX
IEwProjectReportManagerX
IEwProjectSnapshotManagerX
IEwProjectSnapshotX
IEwProjectSymbolManagerX
IEwProjectUpdateReplaceDataX
IEwProjectWireManagerX
IEwProjectX
IEwResumeRowX
IEwRibbonControlX
IEwRibbonGroupX
IEwRibbonTabX
IEwRibbonX
IEwRightsManagerX
IEwSymbolCircuitX
IEwSymbolFiltersX
IEwSymbolManagerX
IEwSymbolPointX
IEwSymbolX
IEwTitleBlockManagerX
IEwTitleBlockX
IEwXLSBookX
IEwXLSSheetX
Expand Class MembersClass Members
Expand SOLIDWORKS PDM Professional API HelpSOLIDWORKS PDM Professional API Help
Expand FeatureWorks API HelpFeatureWorks API Help
Expand SOLIDWORKS Costing API HelpSOLIDWORKS Costing API Help
Expand SOLIDWORKS Document Manager API HelpSOLIDWORKS Document Manager API Help
Expand SOLIDWORKS Routing API HelpSOLIDWORKS Routing API Help
Expand SOLIDWORKS Simulation API HelpSOLIDWORKS Simulation API Help
Expand SOLIDWORKS Sustainability API HelpSOLIDWORKS Sustainability API Help
Expand SOLIDWORKS Toolbox API HelpSOLIDWORKS Toolbox API Help
Expand SOLIDWORKS Utilities API HelpSOLIDWORKS Utilities API Help
Expand eDrawings API HelpeDrawings API Help
Expand DraftSight API HelpDraftSight API Help
Expand Lisp Programming BasicsLisp Programming Basics
Expand Lisp Functions OverviewLisp Functions Overview
Expand Lisp Functions ReferenceLisp Functions Reference
Expand Visual Lisp Compatible FunctionsVisual Lisp Compatible Functions
Hide Table of Contents
SOLIDWORKS Electrical API  2021.0.0
Electrical API
IEwRibbonControlX Interface Reference

Use this interface to manage the control on Ribbon tab. More...

Inheritance diagram for IEwRibbonControlX:

Public Member Functions

BSTR getCaption (EwErrorCode *errorCode)
 Return the caption of this control. More...
 
EwErrorCode setCaption (BSTR strCaption)
 Set a new caption for this control. More...
 
BSTR getToolTip (EwErrorCode *errorCode)
 Return the ToolTip of this control. More...
 
EwErrorCode setToolTip (BSTR strToolTip)
 Set a new ToolTip for this control. More...
 
BSTR getDescription (EwErrorCode *errorCode)
 Return the description of this control. More...
 
EwErrorCode setDescription (BSTR strDescription)
 Set a description for this control. More...
 
VARIANT_BOOL isVisible (EwErrorCode *errorCode)
 Determine if the control is visible. More...
 
EwErrorCode setVisible (VARIANT_BOOL bVisible)
 Hide or show the control. More...
 
VARIANT_BOOL isEnabled (EwErrorCode *errorCode)
 Determine if the control is enabled. More...
 
EwErrorCode setEnabled (VARIANT_BOOL bEnabled)
 Set whether the control is enabled. More...
 
VARIANT_BOOL isBeginGroup (EwErrorCode *errorCode)
 Determine if the control is a separator. More...
 
EwErrorCode setBeginGroup (VARIANT_BOOL bBeginGroup)
 Begin a new group using a separator. More...
 
BSTR getShortcutText (EwErrorCode *errorCode)
 Get the control's shortcut. More...
 
EwErrorCode setShortcutText (BSTR strShortcutText)
 Set the shortcut string of the control. More...
 
EwErrorCode setIconFromImage (BSTR strImageFilePath, EwRibbonButtonSize eRibbonButtonSize, COLORREF crMask)
 Add an icon from file. More...
 
EwRibbonButtonStyle getStyle (EwErrorCode *errorCode)
 Get the control's style. More...
 
EwErrorCode setStyle (EwRibbonButtonStyle eRibbonButtonStyle)
 Set the style of the control. More...
 
long getID (EwErrorCode *errorCode)
 Get the Id's of control. More...
 
BSTR getCommand (EwErrorCode *errorCode)
 Return the text of parameter strCommand used when calling EwRibbonGroupX::addControl. More...
 
EwErrorCode setCommand (BSTR strCommand)
 Set the name of the command associated with this ribbon control. More...
 
IEwRibbonControlX addControl (EwRibbonControlType eRibbonControlType, BSTR strCommand, EwErrorCode *errorCode)
 Add a new control to a pop-up button. More...
 

Detailed Description

Use this interface to manage the control on Ribbon tab.

Since
2019

Member Function Documentation

◆ addControl()

IEwRibbonControlX IEwRibbonControlX::addControl ( EwRibbonControlType  eRibbonControlType,
BSTR  strCommand,
EwErrorCode errorCode 
)

Add a new control to a pop-up button.

Since
2021 SP0.
Parameters
[in]eRibbonControlTypetype of ribbon controm
[in]strCommandthe name of a command to launch. Can be blank.
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized or EwRibbonControlType is invalid
  • EW_BAD_INPUT if eType is not a good type or if the current button is not a pop-up button.
  • EW_UNDEFINED_ERROR if another error occurred
Returns
an IEwRibbonControlX added to the control.

◆ getCaption()

BSTR IEwRibbonControlX::getCaption ( EwErrorCode errorCode)

Return the caption of this control.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
the caption of this control.

◆ getCommand()

BSTR IEwRibbonControlX::getCommand ( EwErrorCode errorCode)

Return the text of parameter strCommand used when calling EwRibbonGroupX::addControl.

Since
2019 SP2
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
the text of parameter strCommand used when calling EwRibbonGroupX::addControl.

◆ getDescription()

BSTR IEwRibbonControlX::getDescription ( EwErrorCode errorCode)

Return the description of this control.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
the description of this control.

◆ getID()

long IEwRibbonControlX::getID ( EwErrorCode errorCode)

Get the Id's of control.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
the id of the control.

◆ getShortcutText()

BSTR IEwRibbonControlX::getShortcutText ( EwErrorCode errorCode)

Get the control's shortcut.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
the shortcut of the control.

◆ getStyle()

EwRibbonButtonStyle IEwRibbonControlX::getStyle ( EwErrorCode errorCode)

Get the control's style.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
the EwRibbonButtonStyle enum control's style.

◆ getToolTip()

BSTR IEwRibbonControlX::getToolTip ( EwErrorCode errorCode)

Return the ToolTip of this control.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
the ToolTip of this control.

◆ isBeginGroup()

VARIANT_BOOL IEwRibbonControlX::isBeginGroup ( EwErrorCode errorCode)

Determine if the control is a separator.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
TRUE if the control starts a new group; otherwise FALSE.

◆ isEnabled()

VARIANT_BOOL IEwRibbonControlX::isEnabled ( EwErrorCode errorCode)

Determine if the control is enabled.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
TRUE if the control is enabled, FALSE otherwise.

◆ isVisible()

VARIANT_BOOL IEwRibbonControlX::isVisible ( EwErrorCode errorCode)

Determine if the control is visible.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred
Returns
TRUE if the control is visible, FALSE otherwise.

◆ setBeginGroup()

EwErrorCode IEwRibbonControlX::setBeginGroup ( VARIANT_BOOL  bBeginGroup)

Begin a new group using a separator.

Parameters
[in]bBeginGroupTRUE if the control starts a new group; otherwise FALSE.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred

◆ setCaption()

EwErrorCode IEwRibbonControlX::setCaption ( BSTR  strCaption)

Set a new caption for this control.

Parameters
[out]strCaptionthe new caption to display.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred

◆ setCommand()

EwErrorCode IEwRibbonControlX::setCommand ( BSTR  strCommand)

Set the name of the command associated with this ribbon control.

Since
2019 SP2
Parameters
[out]strCommandthe new parameter command to execute.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred

◆ setDescription()

EwErrorCode IEwRibbonControlX::setDescription ( BSTR  strDescription)

Set a description for this control.

Parameters
[out]strDescriptionthe new description to display.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred

◆ setEnabled()

EwErrorCode IEwRibbonControlX::setEnabled ( VARIANT_BOOL  bEnabled)

Set whether the control is enabled.

Parameters
[in]bEnabledTRUE to enable the control, FALSE to disable the control. If FALSE, the control will appear "grayed out" and the user can not access the control.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred

◆ setIconFromImage()

EwErrorCode IEwRibbonControlX::setIconFromImage ( BSTR  strImageFilePath,
EwRibbonButtonSize  eRibbonButtonSize,
COLORREF  crMask 
)

Add an icon from file.

Image to buttons should be .ico, .bmp, .png file.

Parameters
[in]strImageFilePaththe full Image file path.
[in]eRibbonButtonSizeenum that define the button size. Default value is kButtonSize32.
[in]crMaskColor mask for BMP and PNG images. Blanck (0x00FFFFFF) by default
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_BAD_INPUTS if the file path doesn't exist or if not a .ico, .bmp, .png file.
  • EW_UNDEFINED_ERROR if another error occurred

◆ setShortcutText()

EwErrorCode IEwRibbonControlX::setShortcutText ( BSTR  strShortcutText)

Set the shortcut string of the control.

Parameters
[in]strShortcutTextShortcut to be set.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred

◆ setStyle()

EwErrorCode IEwRibbonControlX::setStyle ( EwRibbonButtonStyle  eRibbonButtonStyle)

Set the style of the control.

Parameters
[in]eRibbonButtonStyleThe style to be set. Can be any of the values listed in the EwRibbonButtonStyle enum.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_BAD_INPUTS if buttonStyle is not a good button style.
  • EW_UNDEFINED_ERROR if another error occurred

◆ setToolTip()

EwErrorCode IEwRibbonControlX::setToolTip ( BSTR  strToolTip)

Set a new ToolTip for this control.

Parameters
[out]strToolTipthe new ToolTip to display.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred

◆ setVisible()

EwErrorCode IEwRibbonControlX::setVisible ( VARIANT_BOOL  bVisible)

Hide or show the control.

Parameters
[in]bVisibleTRUE to show the control, FALSE to hide the control.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_UNDEFINED_ERROR if another error occurred


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   SOLIDWORKS Electrical API: IEwRibbonControlX Interface Reference
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2021 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.