I am trying to modify global variables within my C# code.
Based on these two examples:
Re: Macro change global variable
I have come up with the following code, but it doesn't change the global variables. Also, when I go into the equation manager after the code runs it has red Xs by the equations and says "The syntax of this equation is incorrect".
string Depth = "\"Depth\" = " + param["Part"].Substring(0, param["Part"].IndexOf("x"));
string flangeWidth = "\"FlangeWidth\" = " + param["Width"];
swEquationMgr = swModel.GetEquationMgr();
swEquationMgr.SetEquationAndConfigurationOption(0, Depth, (int)swInConfigurationOpts_e.swAllConfiguration, null);
swEquationMgr.SetEquationAndConfigurationOption(0, flangeWidth, (int)swInConfigurationOpts_e.swAllConfiguration, null);
NOTE: The Depth variable correctly evaluates to ("Depth" = 8) & flangeWidth evaluates to ("FlangeWidth" = 3.5).
Can anyone help me with what I am doing wrong?