Tuesday, February 07, 2012
Reading dimensions from .psm files
Last Post 11 Feb 2010 02:20 AM by boman. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
bomanUser is Offline
New Member
New Member
Posts:5

--
09 Feb 2010 10:47 AM  

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

 

 

Julian GuilloUser is Offline
Guru
Basic Member
Basic Member
Posts:125

--
09 Feb 2010 12:10 PM  
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
bomanUser is Offline
New Member
New Member
Posts:5

--
11 Feb 2010 02:20 AM  

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

 

 

 

 

 

You are not authorized to post a reply.

Active Forums 4.2
Copyright © 2011 JasonNewell.NET