Reading dimensions from .psm files

 

Hi all

I'm trying to "read" variables from a .psm file (i need to process those variables outside SE). I have no problem reading

the variables but in the "variable" list there are Dimensions. I cant find a way to reach those values.

Can anyone help me?

(using C# as programming language)

 

Kind Regards

 

Kjell-Ake

 

 

 

Posted by: Kjell-Ake Boberg
Post date: 2/9/2010 4:47:22 AM

2 REPLIES

RE: Reading dimensions from .psm files

Kjell-Ake,

 

Search in this newsgroup for a thread called "Problems with modify variables"

I did an extensive explanation of this subject (Dim's and Var's) My post was dated 06/08/2009 10:48 AM

Regards,

Julian

 

Posted by: Julian Guillo
Post date: 2/9/2010 6:10:14 AM

RE: Reading dimensions from .psm files

 

Thanks for the suggestion. Here is a C# sample code snippet that works for Dimensions as well as properties

 

SolidEdgeFramework.

 VariableList vl = (SolidEdgeFramework.VariableList)variables.Query("Dimension_to_look_for", Type.Missing, Type.Missing, false

);

 

 

// If any result.....

 

 if

(vl.Count == 1)

{

 

 

// Get the result in an untyped variable. In this case it can be either a variable or a dimension

 

 object

variable = vl.Item(1);

 // Get the value of the variable by querying "Value" member

 

 

 object Value = variable.GetType().InvokeMember("Value", BindingFlags.GetProperty, null, variable, null);// Now convert the result to a double and multiply with 1000

 // to get a value in mm

Decimal dValue = Convert.ToDecimal(Value) * 1000;Kind Regards

 

Kjell-Åke

 

 

 

 

 

 

Posted by: Kjell-Ake Boberg
Post date: 2/10/2010 8:20:31 PM