×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NX OPEN How to get Sheet_Metal_Material_Thickness

NX OPEN How to get Sheet_Metal_Material_Thickness

NX OPEN How to get Sheet_Metal_Material_Thickness

(OP)
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

RE: NX OPEN How to get Sheet_Metal_Material_Thickness

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 --> Basic

Dim lw As ListingWindow = session.GetSession.ListingWindow
lw.Open() 
add this after the expression_name = exp.Description line

CODE --> Basic

lw.WriteLine("The expression name is: " & expression_name) 

Is the expression name mixed case?

RE: NX OPEN How to get Sheet_Metal_Material_Thickness

(OP)
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.

RE: NX OPEN How to get Sheet_Metal_Material_Thickness

Instead of exp.Description try exp.Name

RE: NX OPEN How to get Sheet_Metal_Material_Thickness

(OP)
Thank you very much moudy1. This was the problem.

Thank you.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources