title: Problems with EquationMgr & SelectionManger Solidworks Api C#
body: <p>I'm trying to understand principles of solidworks API, but have several problems. 
  Here is my code:</p>
  
  <pre><code>for (var i = 0; i &lt; selMgr.GetSelectedObjectCount(); i++)
          {
              var Face = selMgr.GetSelectedObject(i+1);
              surfaces.Add(Face.GetSurface());
              measure = swModel.Extension.CreateMeasure();
  
              if (surfaces[i].IsCylinder())
              {
  
                  // Problem # 1
  
                  Console.WriteLine("Cylinder " + i);
                  measure.Calculate(surfaces[i]);
                  var diameter = measure.Diameter * 1000;
                  var length = 1000 * measure.Perimeter  / (measure.Diameter * Math.PI);
  
                  var temp = swApp.OpenDoc6(@"E:\OAK\Locator9.SLDPRT", 1, 1, "", 0, 0);
                  var part = component.AddComponent5(@"E:\OAK\Locator9.SLDPRT", 0, "", true, "", 0, 0, 0.3);
                  swApp.CloseDoc(@"E:\OAK\Locator9.SLDPRT");
  
                  ModelDoc2 locator = part.GetModelDoc();
  
                  var eqMgr = locator.GetEquationMgr();
  
                  Console.WriteLine("Evaluated diameter " + diameter);
                  Console.WriteLine("Evaluated length " + length);
  
                  Console.WriteLine(eqMgr.Equation[1] + "   " + eqMgr.Equation[2]);
  
  
                  //Problem #2
  
  
                  eqMgr.set_Equation(1, $@"""D""={diameter}");
                  eqMgr.set_Equation(2, $@"""L""={length}");
                  eqMgr.EvaluateAll();
                  locator.EditRebuild3();
                  locator.ForceRebuild3(false);
              }
              else
              {
                  // TODO: Handle other type of surface 
              }
          }
  </code></pre>
  
  <p>1) I want to measure perimeter &amp; diameter of the selected surface. But if a return value of <code>GetSelectedObjectCount()</code> method is greater than 1, <code>measure.Diameter &amp; measure.Perimeter both returns -1</code>. And I kinda understand why, 'cause such operation isn't possible via UI as well, but can I do smth to solve the problem?<br>
  2) The code above has no influence on the equation of the inserted component, even if it writes it on the console. 
  Help please!</p>