Reply
Solved! Go to solution

Getting a reference to a variable in C#

I have this code that I'm trying to use to get a reference to a variable:

SolidEdgePart.PartDocument sePart = seOccur.PartDocument;
SolidEdgeFramework.Variables seVars = sePart.Variables;
SolidEdgeFramework.variable seVar = seVars.Item("WIDTH");

But it fails on the last line.  I have existing VB code that works:

Dim vars As SolidEdgeFramework.Variables = Riser.Variables
Dim var As SolidEdgeFramework.variable = vars.Item(varName)

What is the correct syntax for C#?

Thanks

Terry Tyson
Software Automation Designer
1 REPLY
Solution
Solution
Accepted by topic author terry_tyson
‎06-22-2017 09:06 AM

Re: Getting a reference to a variable in C#

I found what works:

  1. Create a new variable.
  2. Set the original variable equal to the new variable.
  3. Get a reference to the new variable.

 

Terry Tyson
Software Automation Designer