Welcome
Expand Getting StartedGetting Started
Expand SOLIDWORKS API HelpSOLIDWORKS API Help
Collapse SOLIDWORKS Electrical API HelpSOLIDWORKS Electrical API Help
Expand Getting StartedGetting Started
Expand Add a Custom CommandAdd a Custom Command
Expand Add an Add-inAdd an Add-in
Expand Release NotesRelease Notes
Expand SampleSample
Collapse ClassesClasses
Expand Class ListClass List
Class Index
Collapse Class HierarchyClass Hierarchy
Collapse IDispatchIDispatch
IEwAPIX
IEwAddIn
IEwAddinInternalX
IEwApplicationSettingsX
IEwApplicationX
IEwArchiveEnvironmentX
IEwCableCoreX
IEwCableReferenceManagerX
IEwCaptionBarControlX
IEwCaptionBarX
IEwClassificationManagerX
IEwCommandContextX
IEwCommandManagerX
IEwCommandX
IEwDialogAlignPartsParametersSelectorX
IEwDialogLocationSelectorX
IEwDialogMacroSelectorX
IEwDialogManufacturerPartOrderingX
IEwDialogManufacturerPartSelectorX
IEwDialogProgressX
IEwDialogProjectManagerX
IEwDialogResumeX
IEwDialogSummaryX
IEwDialogTaskX
IEwDockingPaneManagerX
IEwDockingPaneX
IEwDocumentManagerX
IEwDocumentX
IEwEnvironmentX
IEwLibraryManagerX
IEwLockStringX
IEwManagerDialogX
IEwManufacturerPartCircuitX
IEwManufacturerPartManagerX
IEwManufacturerPartTerminalX
IEwMenuItemX
IEwMenuManagerX
IEwMenuX
IEwNotificationDialogX
Expand IEwObjectDispatchXIEwObjectDispatchX
IEwPointX
IEwProjectAutomaticArrowsX
IEwProjectBookManagerX
IEwProjectCableManagerX
IEwProjectComponentManagerX
IEwProjectEntity3DManagerX
IEwProjectExcelAutomationX
IEwProjectExportDWGFilesX
IEwProjectExportPDFX
IEwProjectExportPDMX
IEwProjectExportReportX
IEwProjectFileConfigurationManagerX
IEwProjectFileConfigurationX
IEwProjectFileManagerX
IEwProjectFolderManagerX
IEwProjectFunctionManagerX
IEwProjectGenerateTSDrawingX
IEwProjectHarnessManagerX
IEwProjectInputOutputManagerX
IEwProjectLocationManagerX
IEwProjectManagerX
IEwProjectManufacturerPartCircuitX
IEwProjectManufacturerPartManagerX
IEwProjectManufacturerPartTerminalX
IEwProjectMultilingualTextFontX
IEwProjectMultilingualTextManagerX
IEwProjectNumberDocumentsX
IEwProjectNumberMarksX
IEwProjectNumberWiresX
IEwProjectOptimizeWireOrderX
IEwProjectPrintConfigManagerX
IEwProjectReportManagerX
IEwProjectSnapshotManagerX
IEwProjectSnapshotX
IEwProjectSymbolManagerX
IEwProjectUpdateReplaceDataX
IEwProjectWireManagerX
IEwProjectWireStyleManagerX
IEwProjectX
IEwResumeRowX
IEwRibbonComboBoxControlX
IEwRibbonControlX
IEwRibbonGroupX
IEwRibbonQuickAccessControlX
IEwRibbonTabX
IEwRibbonX
IEwRightsManagerX
IEwSaveDWGImageX
IEwSelectorDialogX
IEwSymbolCircuitX
IEwSymbolFiltersX
IEwSymbolManagerX
IEwSymbolPointX
IEwTerminalTypeManagerX
IEwTitleBlockManagerX
IEwWireTerminationTypeManagerX
IEwXLSBookX
IEwXLSSheetX
Expand IInteropFactoryXIInteropFactoryX
Expand Class MembersClass Members
Expand SOLIDWORKS PDM Professional API HelpSOLIDWORKS PDM Professional API Help
Expand PDM Pro API Web ServicePDM Pro API Web Service
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 Inspection API HelpSOLIDWORKS Inspection 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 2024.0.0
Electrical API
IEwApplicationX Interface Reference

Use this interface to manage the application. More...

Inheritance diagram for IEwApplicationX:
Inheritance graph

Public Member Functions

EwErrorCode runCommand (BSTR strCommand)
 Run a command. More...
 
IEwEnvironmentX getEwEnvironment (EwErrorCode *errorCode)
 
IEwEnvironmentX newEwEnvironment ()
 Create a IEwEnvironmentX object from the current API. More...
 
IEwProjectX getEwProjectCurrent (EwErrorCode *errorCode)
 To get the active project. More...
 
IEwDialogSummaryX getEwDialogSummary (EwErrorCode *errorCode)
 To get the summary dialog wrapper. More...
 
IEwDialogManufacturerPartSelectorX getEwDialogManufacturerPartSelector (EwErrorCode *errorCode)
 To get the manufacturer part selector dialog wrapper. More...
 
IEwDialogTaskX getEwDialogTask (EwErrorCode *errorCode)
 To get the task dialog wrapper. More...
 
IEwRightsManagerX getEwRightsManager (EwErrorCode *errorCode)
 To get the rights manager. More...
 
EwErrorCode openEwProjectID (LONG lID)
 Open a project in the application interface. More...
 
EwErrorCode closeEwProjectID (LONG lID)
 Close a project already opened in the application interface. More...
 
IEwDialogManufacturerPartOrderingX getEwDialogManufacturerPartOrdering (EwErrorCode *errorCode)
 To get the manufacturer part ordering dialog wrapper. More...
 
IEwDialogAlignPartsParametersSelectorX getEwDialogAlignPartsParametersSelector (EwErrorCode *errorCode)
 To get align parameters selector dialog wrapper. More...
 
EwErrorCode importFile (BSTR strFileToImport, BSTR strOutputPath)
 To import .ema, .ems files. More...
 
BSTR getApplicationVersion ()
 Get the application version as: 2016.1.2 Version 2016 is the major number, 1 is for minor number, 2 is for Service pack. More...
 
BSTR getApiDllVersion ()
 Get the version of the ActiveX dll loaded in memory. More...
 
IEwDialogLocationSelectorX getEwDialogLocationSelector (EwErrorCode *errorCode)
 To get the location selector dialog wrapper. More...
 
IEwDialogMacroSelectorX getEwDialogMacroSelector (EwErrorCode *errorCode)
 To get the macro selector dialog wrapper. More...
 
IEwApplicationSettingsX getEwApplicationSettings (EwErrorCode *errorCode)
 Get the application settings interface. More...
 
EwErrorCode loadRespan (BSTR strFilePath)
 Load a file with extention .respan containing the definition of a ribbon tab to be added to the application ribbon. More...
 
EwErrorCode unloadRespan (BSTR strFilePath)
 Unload a .respan file. More...
 
BSTR getName ()
 Return the name of application. More...
 
IEwCommandManagerX getEwCommandManager (EwErrorCode *errorCode)
 Get the IEwCommandManagerX command manager interface. More...
 
IEwXLSBookX newEwXLSBook (EwErrorCode *errorCode)
 To get a new XLSBookX wrapper. More...
 
IEwDialogProgressX getEwDialogProgress (EwErrorCode *errorCode)
 Get the progress dialog wrapper. More...
 
IEwDialogResumeX getEwDialogResume (EwErrorCode *errorCode)
 Get the resume dialog wrapper. More...
 
IEwProjectX openProjectFromFilePath (BSTR strFilePath, EwErrorCode *errorCode)
 Open a project from the input file path. More...
 
VARIANT_BOOL isEwProjectOpened (long lProjectId, EwErrorCode *errorCode)
 Return true if the project is opened in application user interface. More...
 
VARIANT_BOOL isEwMacroOpened (long lMacroId, EwErrorCode *errorCode)
 Return true if the macro is opened in application user interface. More...
 
EwErrorCode openEwMacroID (LONG lID)
 Open a macro in the application interface. More...
 
EwErrorCode closeEwMacroID (LONG lID)
 Close a macro already opened in the application interface. More...
 
BSTR findFile (BSTR strFileName, EwErrorCode *errorCode)
 Find a file in application folders. More...
 
BSTR getWinAppName ()
 return 2D application name, to substitute WIN_APP_NAME in the resource strings More...
 
IEwRibbonX getEwRibbon (EwErrorCode *errorCode)
 return an IEwRibbonX interface to EwRibbonX object. More...
 
BSTR getFolderPath (EwApplicationFolderPathValue eApplicationFolderPathValue, EwErrorCode *errorCode)
 Return path of utility application folder, next to binary folder. More...
 
EwErrorCode activate ()
 Activate the application. More...
 
EwApISoftType getApplicationType (EwErrorCode *errorCode)
 Return application type. More...
 
EwErrorCode getSystemInformation (BSTR strPath)
 Collect information on electrical application. More...
 
EwPdmType getEwPdmType (EwErrorCode *errorCode)
 Return current EwPdmType enum type. More...
 
EwErrorCode setEwPdmType (EwPdmType ePdmType)
 Set type of PDM integration. More...
 
EwErrorCode close ()
 Close the application. More...
 
IEwDialogProjectManagerX getEwDialogProjectManager (EwErrorCode *errorCode)
 
IEwDockingPaneManagerX getEwDockingPaneManager (EwErrorCode *errorCode)
 return an IEwDockingPaneManagerX interface to EwDockingPaneManagerX object. More...
 
IEwSaveDWGImageX newEwSaveDWGImage (EwErrorCode *errorCode)
 Create an object to convert DWG on picture. More...
 
IEwCaptionBarX getEwCaptionBar (EwErrorCode *errorCode)
 Return an IEwCaptionBarX interface to manage the software Caption Bar. More...
 
IEwManagerDialogX getEwManagerDialogObject (EwDialogManagerType eDialogManager, EwErrorCode *errorCode)
 Get the Manager dialog wrapper with the IEwManagerDialogX interface. More...
 
IEwSelectorDialogX getEwSelectorDialogObject (EwDialogSelectorType eDialogSelector, EwErrorCode *errorCode)
 Get the Selector dialog wrapper with the IEwSelectorDialogX interface. More...
 
IEwDocumentX getEwDocumentCurrent (EwErrorCode *errorCode)
 Get the IEwDocumentX from current document. More...
 
IEwDocumentManagerX getEwDocumentManager (EwErrorCode *errorCode)
 Get IEwDocumentManagerX object to manage all the Document in the application. More...
 
IEwMenuManagerX getEwMenuManager (EwErrorCode *errorCode)
 Get the IEwMenuManagerX object to manage all the API context menu in the application. More...
 
IEwESX3DExperienceX getEwESX3DExperienceX (EwErrorCode *errorCode)
 Get the IEwESX3DExperienceX object to manage 3DExperience platform operation. More...
 
IDispatch getSWCEFComApplication (EwErrorCode *errorCode)
 Get SWCEFComApplication in a singleton way. More...
 

Detailed Description

Use this interface to manage the application.

Since
2018 SP0

Member Function Documentation

◆ activate()

EwErrorCode IEwApplicationX::activate ( )

Activate the application.

Since
2019
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT there is no application
  • EW_UNDEFINED_ERROR if another error occurred

◆ close()

EwErrorCode IEwApplicationX::close ( )

Close the application.

It will close all opened projects and files.

Since
2020 SP0
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_UNDEFINED_ERROR if another error occurred

◆ closeEwMacroID()

EwErrorCode IEwApplicationX::closeEwMacroID ( LONG  lID)

Close a macro already opened in the application interface.

Since
2019
Parameters
[in]lIDID of the macro to close
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
  • EW_CANNOT_CLOSE_PROJECT if project cannot be closed

◆ closeEwProjectID()

EwErrorCode IEwApplicationX::closeEwProjectID ( LONG  lID)

Close a project already opened in the application interface.

Parameters
[in]lIDID of the project to close
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
  • EW_CANNOT_CLOSE_PROJECT if project cannot be closed

◆ findFile()

BSTR IEwApplicationX::findFile ( BSTR  strFileName,
EwErrorCode errorCode 
)

Find a file in application folders.

Since
2019
Parameters
[in]strFileNameFile name to find
[out]errorCodeError code,
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_FILE_NOT_FOUND if the file not found
Returns
Full path to the file found

◆ getApiDllVersion()

BSTR IEwApplicationX::getApiDllVersion ( )

Get the version of the ActiveX dll loaded in memory.

If Dll version is different from application version, it means that the registered dll is not the good one. formated version like 2017.1.2 (2017 for major, 1 for mino, 2 for Service pack)

Returns
"Dll version" instead of version of apix

◆ getApplicationType()

EwApISoftType IEwApplicationX::getApplicationType ( EwErrorCode errorCode)

Return application type.

Since
2020 SP0
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT there is no application
  • EW_UNDEFINED_ERROR if another error occurred
Returns
application Type (EW2D, SW2D, SW3D)

◆ getApplicationVersion()

BSTR IEwApplicationX::getApplicationVersion ( )

Get the application version as: 2016.1.2 Version 2016 is the major number, 1 is for minor number, 2 is for Service pack.

Returns
Application Version

◆ getEwApplicationSettings()

IEwApplicationSettingsX IEwApplicationX::getEwApplicationSettings ( EwErrorCode errorCode)

Get the application settings interface.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the application settings interface

◆ getEwCaptionBar()

IEwCaptionBarX IEwApplicationX::getEwCaptionBar ( EwErrorCode errorCode)

Return an IEwCaptionBarX interface to manage the software Caption Bar.

Since
2022 SP0
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT If there is no main window or main window does not have caption bar
  • EW_UNDEFINED_ERROR if another error occurred
Returns
an IEwCaptionBarX interface to manage the software Caption Bar.

◆ getEwCommandManager()

IEwCommandManagerX IEwApplicationX::getEwCommandManager ( EwErrorCode errorCode)

Get the IEwCommandManagerX command manager interface.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the IEwCommandManagerX command manager interface.

◆ getEwDialogAlignPartsParametersSelector()

IEwDialogAlignPartsParametersSelectorX IEwApplicationX::getEwDialogAlignPartsParametersSelector ( EwErrorCode errorCode)

To get align parameters selector dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the dialog wrapper

◆ getEwDialogLocationSelector()

IEwDialogLocationSelectorX IEwApplicationX::getEwDialogLocationSelector ( EwErrorCode errorCode)

To get the location selector dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the summary dialog wrapper

◆ getEwDialogMacroSelector()

IEwDialogMacroSelectorX IEwApplicationX::getEwDialogMacroSelector ( EwErrorCode errorCode)

To get the macro selector dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the macro selector dialog wrapper

◆ getEwDialogManufacturerPartOrdering()

IEwDialogManufacturerPartOrderingX IEwApplicationX::getEwDialogManufacturerPartOrdering ( EwErrorCode errorCode)

To get the manufacturer part ordering dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the dialog wrapper

◆ getEwDialogManufacturerPartSelector()

IEwDialogManufacturerPartSelectorX IEwApplicationX::getEwDialogManufacturerPartSelector ( EwErrorCode errorCode)

To get the manufacturer part selector dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the summary dialog wrapper

◆ getEwDialogProgress()

IEwDialogProgressX IEwApplicationX::getEwDialogProgress ( EwErrorCode errorCode)

Get the progress dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
Returns
the progress dialog wrapper

◆ getEwDialogProjectManager()

IEwDialogProjectManagerX IEwApplicationX::getEwDialogProjectManager ( EwErrorCode errorCode)
Warning
This interface is deprecated, use getEwManagerDialogObject instead. Get the Project Manager dialog wrapper with the IEwDialogProjectManagerX interface.
Since
2021 SP0
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the Project Manager dialog wrapper

◆ getEwDialogResume()

IEwDialogResumeX IEwApplicationX::getEwDialogResume ( EwErrorCode errorCode)

Get the resume dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
Returns
the resume dialog wrapper

◆ getEwDialogSummary()

IEwDialogSummaryX IEwApplicationX::getEwDialogSummary ( EwErrorCode errorCode)

To get the summary dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the summary dialog wrapper

◆ getEwDialogTask()

IEwDialogTaskX IEwApplicationX::getEwDialogTask ( EwErrorCode errorCode)

To get the task dialog wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the task dialog wrapper

◆ getEwDockingPaneManager()

IEwDockingPaneManagerX IEwApplicationX::getEwDockingPaneManager ( EwErrorCode errorCode)

return an IEwDockingPaneManagerX interface to EwDockingPaneManagerX object.

Since
2021 SP0
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT If there is no main window or main window does not have ribbon bar
  • EW_UNDEFINED_ERROR if another error occurred
Returns
an IEwDockingPaneManagerX interface to EwDockingPaneManagerX object.

◆ getEwDocumentCurrent()

IEwDocumentX IEwApplicationX::getEwDocumentCurrent ( EwErrorCode errorCode)

Get the IEwDocumentX from current document.

Since
2022 SP1
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_OBJECT_NOT_FOUND if current document object is not found
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the IEwDocumentX object from current document

◆ getEwDocumentManager()

IEwDocumentManagerX IEwApplicationX::getEwDocumentManager ( EwErrorCode errorCode)

Get IEwDocumentManagerX object to manage all the Document in the application.

Since
2022 SP1
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_UNDEFINED_ERROR if another error occurred
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
  • EW_NO_ERROR if no error detected
Returns
IEwDocumentManagerX to manage all the documents in the application.

◆ getEwEnvironment()

IEwEnvironmentX IEwApplicationX::getEwEnvironment ( EwErrorCode errorCode)
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_NO_ACTIVEPROJECT if no active project
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
An the IEwEnvironmentX of the application

◆ getEwESX3DExperienceX()

IEwESX3DExperienceX IEwApplicationX::getEwESX3DExperienceX ( EwErrorCode errorCode)

Get the IEwESX3DExperienceX object to manage 3DExperience platform operation.

Since
2022 SP4
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the IEwESX3DExperienceX object to manage 3DExperience platform operation.

◆ getEwManagerDialogObject()

IEwManagerDialogX IEwApplicationX::getEwManagerDialogObject ( EwDialogManagerType  eDialogManager,
EwErrorCode errorCode 
)

Get the Manager dialog wrapper with the IEwManagerDialogX interface.

Since
2022 SP0
Parameters
[in]eDialogManagerEwDialogManagerType enum type, used to get the specific manager dialog wrapper.
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the Manager dialog wrapper

◆ getEwMenuManager()

IEwMenuManagerX IEwApplicationX::getEwMenuManager ( EwErrorCode errorCode)

Get the IEwMenuManagerX object to manage all the API context menu in the application.

Since
2022 SP2
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_OBJECT_NOT_FOUND if current document object is not found
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the IEwMenuManagerX object to manage all API context menu in the application.

◆ getEwPdmType()

EwPdmType IEwApplicationX::getEwPdmType ( EwErrorCode errorCode)

Return current EwPdmType enum type.

Since
2020 SP0
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_UNDEFINED_ERROR if another error occurred
Returns
EwPdmType type of PDM integration.

◆ getEwProjectCurrent()

IEwProjectX IEwApplicationX::getEwProjectCurrent ( EwErrorCode errorCode)

To get the active project.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_NO_ACTIVEPROJECT if no active project
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the current project of the application

◆ getEwRibbon()

IEwRibbonX IEwApplicationX::getEwRibbon ( EwErrorCode errorCode)

return an IEwRibbonX interface to EwRibbonX object.

Since
2019
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT If there is no main window or main window does not have ribbon bar
  • EW_UNDEFINED_ERROR if another error occurred
Returns
an IEwRibbonX interface to EwRibbonX object.

◆ getEwRightsManager()

IEwRightsManagerX IEwApplicationX::getEwRightsManager ( EwErrorCode errorCode)

To get the rights manager.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the rights manager wrapper

◆ getEwSelectorDialogObject()

IEwSelectorDialogX IEwApplicationX::getEwSelectorDialogObject ( EwDialogSelectorType  eDialogSelector,
EwErrorCode errorCode 
)

Get the Selector dialog wrapper with the IEwSelectorDialogX interface.

Since
2022 SP2
Parameters
[in]eDialogSelectorEwDialogSelectorType enum type, used to get the specific Selector dialog wrapper.
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the Selector dialog wrapper

◆ getFolderPath()

BSTR IEwApplicationX::getFolderPath ( EwApplicationFolderPathValue  eApplicationFolderPathValue,
EwErrorCode errorCode 
)

Return path of utility application folder, next to binary folder.

Since
2018 SP4
Parameters
[in]eApplicationFolderPathValueset an EwApplicationFolderPathValue enum value
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
  • EW_UNDEFINED_ERROR if another error occurred
  • EW_OUT_OF_SCOPE request type is out of scope
Returns
string Folder path of request , empty if failed

◆ getName()

BSTR IEwApplicationX::getName ( )

Return the name of application.

Returns
the name of application.

◆ getSWCEFComApplication()

IDispatch IEwApplicationX::getSWCEFComApplication ( EwErrorCode errorCode)

Get SWCEFComApplication in a singleton way.

Since
2023 SP1
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_API_NOT_SUPPORTED if the API is not available for this application
  • EW_OBJECT_NOT_FOUND if the SWCEFComApplication object cannot be found
  • EW_CANNOT_INITIALIZE if the SWCEFComApplication object cannot be created
  • EW_UNDEFINED_ERROR if another error occurred
Returns
iDisp SWCEFComApplication singleton pointer

◆ getSystemInformation()

EwErrorCode IEwApplicationX::getSystemInformation ( BSTR  strPath)

Collect information on electrical application.

If the UAC is actived some informations cannot be collected.

Since
2020 SP0
Parameters
[in]strPathpath to copy generated files.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_BAD_INPUTS if path is empty
  • EW_DOES_NOT_EXIST_ERROR if path do not exist.
  • EW_UNDEFINED_ERROR if another error occurred

◆ getWinAppName()

BSTR IEwApplicationX::getWinAppName ( )

return 2D application name, to substitute WIN_APP_NAME in the resource strings

◆ importFile()

EwErrorCode IEwApplicationX::importFile ( BSTR  strFileToImport,
BSTR  strOutputPath 
)

To import .ema, .ems files.

Parameters
[in]strFileToImportThe file name to import
[in]strOutputPathOutput folder path where tewzip file will be generated. Folder path must exists. \ If folder path is empty no file will be created but macro will be imported in application database.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_FILE_NOT_FOUND if exported Dll was not found
  • EW_API_NOT_SUPPORTED if the API is not available for this application
  • EW_NO_EWLIBRARY_EXIST if the necessary import folder doesn't exists.
  • EW_BAD_INPUTS if the file to import is not found.

◆ isEwMacroOpened()

VARIANT_BOOL IEwApplicationX::isEwMacroOpened ( long  lMacroId,
EwErrorCode errorCode 
)

Return true if the macro is opened in application user interface.

Since
2019
Parameters
[in]lMacroIdthe id of the macro to test
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_BAD_INPUT if the lMacroId is negative
  • EW_OBJECT_NOT_FOUND if the lMacroId is not found in the project
  • EW_UNDEFINED_ERROR if another error occurred
Returns
true if the macro is opened in application user interface.

◆ isEwProjectOpened()

VARIANT_BOOL IEwApplicationX::isEwProjectOpened ( long  lProjectId,
EwErrorCode errorCode 
)

Return true if the project is opened in application user interface.

Since
2019
Parameters
[in]lProjectIdthe id of the project to test
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_BAD_INPUT if the lProjectId is negative
  • EW_OBJECT_NOT_FOUND if the lProjectId is not found in the project
  • EW_UNDEFINED_ERROR if another error occurred
Returns
true if the project is opened in application user interface.

◆ loadRespan()

EwErrorCode IEwApplicationX::loadRespan ( BSTR  strFilePath)

Load a file with extention .respan containing the definition of a ribbon tab to be added to the application ribbon.

Parameters
[in]strFilePathFile path of the custom pane
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_FILE_NOT_FOUND if strFilePath doesn't exist

◆ newEwEnvironment()

IEwEnvironmentX IEwApplicationX::newEwEnvironment ( )

Create a IEwEnvironmentX object from the current API.

Returns
An IEwEnvironmentX connected to the current API

◆ newEwSaveDWGImage()

IEwSaveDWGImageX IEwApplicationX::newEwSaveDWGImage ( EwErrorCode errorCode)

Create an object to convert DWG on picture.

Since
2022 SP0
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_UNDEFINED_ERROR if another error occurred
Returns
IEwSaveDWGImageX object interface .

◆ newEwXLSBook()

IEwXLSBookX IEwApplicationX::newEwXLSBook ( EwErrorCode errorCode)

To get a new XLSBookX wrapper.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized or XLSBookX wrapper is null
  • EW_API_NOT_SUPPORTED if the API is not available for this application
Returns
the XLSBookX wrapper

◆ openEwMacroID()

EwErrorCode IEwApplicationX::openEwMacroID ( LONG  lID)

Open a macro in the application interface.

Since
2019
Parameters
[in]lIDID of the macro to open
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_BAD_INPUT if the lID is negative
  • EW_OBJECT_NOT_FOUND if the lID is not found in the project
  • EW_CANNOT_OPEN_PROJECT if macro cannot be opened

◆ openEwProjectID()

EwErrorCode IEwApplicationX::openEwProjectID ( LONG  lID)

Open a project in the application interface.

Parameters
[in]lIDID of the project to open
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_BAD_INPUT if the lID is negative
  • EW_OBJECT_NOT_FOUND if the lID is not found in the project
  • EW_CANNOT_OPEN_PROJECT if project cannot be opened

◆ openProjectFromFilePath()

IEwProjectX IEwApplicationX::openProjectFromFilePath ( BSTR  strFilePath,
EwErrorCode errorCode 
)

Open a project from the input file path.

Since
2019
Parameters
[in]strFilePathFull file path
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_FILE_NOT_FOUND The file path does not exist
  • EW_UNDEFINED_ERROR if another error occurred
Returns
A valid object if the project is opened, null object otherwise.

◆ runCommand()

EwErrorCode IEwApplicationX::runCommand ( BSTR  strCommand)

Run a command.

Parameters
[in]strCommandThe command to run
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_API_NOT_SUPPORTED if the API is not available for this application
  • EW_BAD_INPUTS if the command to run is not existing
  • EW_OPERATION_CANCELED if user cancel the command
  • EW_UNDEFINED_ERROR if another error occurred

◆ setEwPdmType()

EwErrorCode IEwApplicationX::setEwPdmType ( EwPdmType  ePdmType)

Set type of PDM integration.

Since
2020 SP0
Parameters
[in]ePdmTypeEwPdmType enum value for PDM integration tha tcould be: kPdmSwEntreprise, kPdmBasic, kPdmThirdParty
Returns
ewErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_BAD_INPUTS ewPdmType is invalid (only use: kPdmSwEntreprise , kPdmBasic , kPdmThirdParty)
  • EW_INVALID_LICENSE no valid licence to use specified PDM Type
  • EW_UNDEFINED_ERROR if another error occurred

◆ unloadRespan()

EwErrorCode IEwApplicationX::unloadRespan ( BSTR  strFilePath)

Unload a .respan file.

Parameters
[in]strFilePathFile path of the custom pane
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected
  • EW_INVALID_OBJECT if object is not initialized
  • EW_FILE_NOT_FOUND if strFilePath doesn't exist


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: IEwApplicationX 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) 2024 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.