Hide Table of Contents
RunCommand Method (IApplication)
Errors[out]
Status of running the command as defined in dsRunCommandError_e

Runs the specified command.

.NET Syntax

Visual Basic (Declaration) 
Function RunCommand( _
   const dsString& CommandString As System.String, _
   bool HideCommandTitle As System.Boolean _
) As dsRunCommandError_e
C# 
dsRunCommandError_e RunCommand( 
   System.string CommandString,
   System.bool HideCommandTitle
)
JavaScript 
RunCommand( 
   CommandString : String,
   HideCommandTitle : Boolean
) : String
COM native C++ 
HRESULT RunCommand( 
   BSTR CommandString,
   VARIANT_BOOL HideCommandTitle,
   dsRunCommandError_e* Errors
) 
C++ 
DSRESULT RunCommand( 
   const dsString& CommandString,
   bool HideCommandTitle,
   dsRunCommandError_e* Errors
) 

Parameters

CommandString
Name of command to run (see Remarks)
HideCommandTitle
True to hide the command in the command window, false to show the command in the command window
Errors[out] or Return Value
Status of running the command as defined in dsRunCommandError_e

Example

Remarks

Depending on the programming language that you use, either:

      • append \n to the command
        - or -
      • include & Chr(10) after the command

        These control strings emulate a user pressing the Enter key in DraftSight. The number of control strings should correspond to the number of times a user is required to press the Enter key for the command in DraftSight.

For example: 

To delete all entities in a drawing in this programming language... Call...
C#

int state;

state = (int)dsApp.RunCommand("DELETE ALL\n\n", false);

VB.NET

Dim state as Integer;

state = dsApp.RunCommand("DELETE ALL" & Chr(10) & Chr(10), False)

VBA

Dim state as Long;

state = dsApp.RunCommand("DELETE ALL" & Chr(10) & Chr(10), False)

 

 

See Also

Availability

DraftSight V1R1


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:   RunCommand Method (IApplication)
*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) 2023 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.