elletheman
Mechanical
Hello,
I made a simple UI and want to control 2 parameters in the expression list with it.
Im not so familiar with journal more than recording and changing values so if someone could help it would be great!
When i do a recording changing the values it looks like this
' NX 9.0.0.19
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
' ----------------------------------------------
' Menu: Tools->Expressions...
' ----------------------------------------------
theSession.Preferences.Modeling.UpdatePending = False
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Expression")
Dim expression1 As Expression = CType(workPart.Expressions.FindObject("Stalldon_Kort"), Expression)
Dim unit1 As Unit = CType(workPart.UnitCollection.FindObject("MilliMeter"), Unit)
workPart.Expressions.EditWithUnits(expression1, unit1, "100")
Dim expression2 As Expression = CType(workPart.Expressions.FindObject("Stalldon_lang"), Expression)
workPart.Expressions.EditWithUnits(expression2, unit1, "200")
theSession.Preferences.Modeling.UpdatePending = False
Dim nErrs1 As Integer
nErrs1 = theSession.UpdateManager.DoUpdate(markId1)
' ----------------------------------------------
' Menu: Tools->Journal->Stop Recording
' ----------------------------------------------
End Sub
End Module
I made a simple UI and want to control 2 parameters in the expression list with it.
Im not so familiar with journal more than recording and changing values so if someone could help it would be great!
When i do a recording changing the values it looks like this
' NX 9.0.0.19
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
' ----------------------------------------------
' Menu: Tools->Expressions...
' ----------------------------------------------
theSession.Preferences.Modeling.UpdatePending = False
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Expression")
Dim expression1 As Expression = CType(workPart.Expressions.FindObject("Stalldon_Kort"), Expression)
Dim unit1 As Unit = CType(workPart.UnitCollection.FindObject("MilliMeter"), Unit)
workPart.Expressions.EditWithUnits(expression1, unit1, "100")
Dim expression2 As Expression = CType(workPart.Expressions.FindObject("Stalldon_lang"), Expression)
workPart.Expressions.EditWithUnits(expression2, unit1, "200")
theSession.Preferences.Modeling.UpdatePending = False
Dim nErrs1 As Integer
nErrs1 = theSession.UpdateManager.DoUpdate(markId1)
' ----------------------------------------------
' Menu: Tools->Journal->Stop Recording
' ----------------------------------------------
End Sub
End Module