benwade
Mechanical
- Jan 5, 2011
- 4
Hi, I'm using NX7.5 and Visual Studio 2010. I'm trying to read the numerical value of an expression (e.g 20mm) and display this in a text box in my visual basic program. This is the code I have so far which was created using the NX Journal feature.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Load default values
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Expression")
Dim expression1 As Expression = CType(workPart.Expressions.FindObject("dblRawMaterialWidth"), Expression)
This is finding a dimension which I have called 'dblRawMaterialWidth' but I now want to read the value of this and display it in a text box on my form. Any ideas?
Many Thanks,
Ben
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Load default values
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Expression")
Dim expression1 As Expression = CType(workPart.Expressions.FindObject("dblRawMaterialWidth"), Expression)
This is finding a dimension which I have called 'dblRawMaterialWidth' but I now want to read the value of this and display it in a text box on my form. Any ideas?
Many Thanks,
Ben