Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX OPEN How to get Sheet_Metal_Material_Thickness 1

Status
Not open for further replies.

spadazenon

Mechanical
Mar 28, 2010
49
Hello everyone,

I would like to get the value to string for the Sheet_Metal_Material_Thickness of a Sheet Metal Part using NXOpen.

I am trying the following but with no luck:

For Each exp As Expression In exps
expression_name = exp.Description
index1 = expression_name.IndexOf("Thickness")
If index1 > 0 Then
hstring2=exp.RightHandSide.ToString
msgbox(exp.name & " = " & hstring2)
End If
Next

I don't know what Iam doing wrong.

Thank you
 
Replies continue below

Recommended for you

Is expression name declared as a string? Have you tried outputing your expression_name to the listing window?
Add the following prior to your For Each.
Code:
Dim lw As ListingWindow = session.GetSession.ListingWindow
lw.Open()
add this after the expression_name = exp.Description line
Code:
lw.WriteLine("The expression name is: " & expression_name)

Is the expression name mixed case?
 
Dear Moudy1,

I did place the code you told me and I get blank lines and other expressions but not the expression I was looking for. For example:

...
The expression name is: (Simple Hole(7) Positioning Dimension Perpendicular Distance )
The expression name is: (Pattern Face(13) Offset in YC...)
The expression name is: (Extrude(16) Start Limit)
The expression name is:
The expression name is:
The expression name is: (Extrude(19) Parallel Dimension between Line16 and Line16)
The expression name is: (Extrude(19) Start Limit)
The expression name is:
The expression name is: (Move Face(21) Displacement)
...

But I cannot get the value (as a string) for the named expression "Sheet_Metal_Material_Thickness". This is what I am looking for.
 
Thank you very much moudy1. This was the problem.

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor