Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Mar 28, 2010
Messages
49
Location
GR
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
 
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.
 
Instead of exp.Description try exp.Name
 
Thank you very much moudy1. This was the problem.

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top