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

Purpose

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

Scope

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

commands

Open a project file

This command open a file from a project

  • Command Name:
    EWOPENFILE
  • 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"
    Note
    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;
    mEwApplicationX.runcommand(strCommand);

Create new project

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

  • Command Name:
    ewNewProjectNoProperties
  • 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:
    showContextHelp
  • 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:
    EWCOLLECTINFORMATION
  • Parameters: None.
...
mEwApplicationX.runCommand("EWCOLLECTINFORMATION");
...
EwErrorCode
All errors codes for this API.
Definition: EnumDefinition.idl:21
EwErrorCode runCommand(BSTR strCommand)
Run a command.


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: List of SWE commands
*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.