Hide Table of Contents
SOLIDWORKS Electrical API 2023.0.0
Electrical API
List of SWE commands


This document explains how to use some useful commands in the application.


Following activities are within the scope of this document:

  • Open file from file path.
  • Create new project.
  • Open help topic.
  • Collect information on Electrical Software.
  • more soon


Open a project file

This command open a file from a project

  • Command Name:
  • Parameters:
    Name: strPathFile
    Data Type: string
    Field: Required
    Description: The full path of the file to open.
    Example: "D:\\ProgramData\\...\\Projects\\1216\\Drawings\\11319.ewg"
    To obtain the path use the getFilePath API from EwProjectFileX object.
    EwErrorCode ewErrorCode = EwErrorCode.EW_UNDEFINED_ERROR;
    \\ ewProjectFile: the file to open.
    string strFilePath = ewProjectFile.getFilePath();
    string strCommand = "EWOPEN ";
    strCommand += strFilePath;
    All errors codes for this API.
    Definition: EnumDefinition.idl:21

Create new project

This command creates automatically a new project without displaying any dialog.

  • Command Name:
  • Parameters:
    Name: strTemplate
    Data Type: string
    Field: Required
    Description: The template file name to create the new project. This name is the file name stored in the template directory of the data folder.
    Example: "AINSI"
    Name: strLanguage
    Data Type: string
    Field: Required
    Description: The language name used for the new project. EN for English, FR for French, ...
    Example: "FR"
    mEwApplicationX.runCommand("ewNewProjectNoProperties IEC EN");

open help topic

This section launch automatically the help

  • Command Name:
  • Parameters:
    Name: strKeyWord
    Data Type: string
    Field: Required
    Description: The key word to find.
    Example: "EwAPI"
    mEwApplicationX.runCommand("showContextHelp EwEnvironmentArchiverDlg");

Collect information

This command collect in a text file all information related to the application, like computer configuration, installation type...

  • Command Name:
  • Parameters: None.

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

Subject:   Feedback on Help Topics
Page:   SOLIDWORKS Electrical API: List of SWE commands
*   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:


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

Web Help Content Version: API Help (English only) 2023 SP04

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.