Hide Table of Contents
Add2 Method (IEquationMgr)

Adds an equation at the specified index.

.NET Syntax

Visual Basic (Declaration) 
Function Add2( _
   ByVal Index As System.Integer, _
   ByVal Equation As System.String, _
   ByVal Solve As System.Boolean _
) 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 value As System.Integer
value = instance.Add2(Index, Equation, Solve)
System.int Add2( 
   System.int Index,
   System.string Equation,
   System.bool Solve
System.int Add2( 
&   System.int Index,
&   System.String^ Equation,
&   System.bool Solve


Index of the new equation (-1 places it at the end of the list)
String containing the equation
True to solve the equation immediately; false otherwise

Return Value

-1 for both success and failure



The string specified for the equation argument must be formatted as if entered in the SolidWorks user interface (that is, you must embed the names of the dimensions in double quotes). For example:


"N_SPOKES@CirPattern1" = "BARLENGTH@Sketch2" /10


You can also use the Visual Basic IIf function when specifying a model dimension in the equation argument. For example:

"D1@Extrude2" = (IIf("D1@Extrude3">20, 15, 6))+5

Setting the Solve argument 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 IEquationaMgr::EvaluateAll or IModelDoc2::EditRebuild3.


See Also


SolidWorks 2010 FCS, Revision Number 18.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:   Add2 Method (IEquationMgr)
*   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) 2013 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.