Hide Table of Contents
Add3 Method (IEquationMgr)

Adds an equation at the specified index for the specified configurations.

.NET Syntax

Visual Basic (Declaration) 
Function Add3( _
   ByVal Index As System.Integer, _
   ByVal Equation As System.String, _
   ByVal Solve As System.Boolean, _
   ByVal WhichConfigurations As System.Integer, _
   ByVal ConfigNames As System.Object _
) As System.Integer
Visual Basic (Usage) 
Dim instance As IEquationMgr
Dim Index As System.Integer
Dim Equation As System.String
Dim Solve As System.Boolean
Dim WhichConfigurations As System.Integer
Dim ConfigNames As System.Object
Dim value As System.Integer
value = instance.Add3(Index, Equation, Solve, WhichConfigurations, ConfigNames)
System.int Add3( 
   System.int Index,
   System.string Equation,
   System.bool Solve,
   System.int WhichConfigurations,
   System.object ConfigNames
System.int Add3( 
&   System.int Index,
&   System.String^ Equation,
&   System.bool Solve,
&   System.int WhichConfigurations,
&   System.Object^ ConfigNames


Index of the new equation (-1 places it at the end of the list)
String containing the equation (see Remarks)
True to solve the equation immediately; false to solve later (see Remarks)
Configuration option as defined in swInConfigurationOpts_e (see Remarks)
Array of the names of the configurations to which to add this equation; valid only if WhichConfigurations is set to swInConfigurationOpts_e.swSpecifyConfiguration, in which case, include the name of the current configuration in this array

Return Value

Index of the new equation if successfully added, -1 if error



This method only works for parts having multple configurations created in SolidWorks 2014 or later. Use this method to add dimension equations, component equations, or global variable assignments to various configurations of models. If you don't have multiple configurations, then call IEquationMgr::Add2, which does not support configurations and is slightly faster.


To add an equation using the SolidWorks user interface, you must embed the names of dimensions and global variables in double quotes: 


    • Global variable assignment:
      "B" = 2    
    • Component equation:
      "N_SPOKES@CirPattern" = "BARLENGTH@Sketch2" /10
    • Dimension equation that uses the Visual Basic IIf function:
      "D1@Extrude2" = (IIf("D1@Extrude3">20, 15, 6))+5
    • Dimension equation that sets a dimension to the current value:
      "D1@Extrude2" =    

NOTE: To add an equation using this method, you must specify Equation with the names of dimensions and global variables in double double quotes and the entire equation in double quotes. See the Examples.

You can add a dimension equation whose left-hand side already exists, but only if the existing equation is suppressed. Adding the equation again unsuppresses it. See IEquationMgr::ChangeSuppressionForAllConfigurations and IEquationMgr::ChangeSuppressionForConfiguration.

Setting Solve to false delays evaluation of this equation, which enhances performance when there are many equations to solve. When Solve is set to false, the equation appears in the FeatureManager design tree only after calling IEquationMgr::EvaluateAll or IModelDoc2::EditRebuild3.

When adding global variable assignments and component equations, WhichConfigurations must be set to swInConfigurationOpts_e.swAllConfiguration. 

If you add a global variable assignment that already exists, this method returns an error.

To modify an equation added by this method, call IEquationMgr::SetEquationAndConfigurationOption.


See Also


SolidWorks 2014 FCS, Revision Number 22.0

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:   Add3 Method (IEquationMgr)

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) 2014 SP05

The search functionality within the web help is in a beta test phase and you may experience periodic delays or interruptions in its performance. These are the normal and ordinary features of a beta test and shall not under any circumstances give rise to any liability on the part of Dassault Systèmes SolidWorks Corporation or its licensors. The topics within the Web-based help are not beta topics; they document API Help (English only) 2014 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.