bhavyarani
Mechanical
- May 2, 2015
- 11
Hello All,
I have created some vb scripts using Visual Studio 2019 and NX is installed in same machine. Dll or Exe runs fine.
Same dll or exe if I share to other machines and test in NX it is not working.
I guess something to do with Setting. Can someone help me on this.
Code for reference:
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.Annotations
Public Class NXOpenWinForm
Dim nx As Session
Dim nxpart As Part
Dim nxUI As UI
Dim nxexpressions As ExpressionCollection
Dim nxexpression As Expression
Public Shared Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = Session.LibraryUnloadOption.Immediately
End Function
Private Sub NXOpenWinForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
nx = Session.GetSession()
nxUI = UI.GetUI()
nxpart = nx.Parts.Work
nxexpressions = nxpart.Expressions
nxexpression = nxpart.FindObject("Length")
TextBox1.Text = nxexpression.Value
nxexpression = nxpart.FindObject("Width")
TextBox2.Text = nxexpression.Value
nxexpression = nxpart.FindObject("Height")
TextBox3.Text = nxexpression.Value
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
nxexpression = nxpart.FindObject("Length")
nxexpressions.Edit(nxexpression, TextBox1.Text)
nxexpression = nxpart.FindObject("Width")
nxexpressions.Edit(nxexpression, TextBox2.Text)
nxexpression = nxpart.FindObject("Height")
nxexpressions.Edit(nxexpression, TextBox3.Text)
Dim umID As Session.UndoMarkId = Nothing
nx.UpdateManager.DoUpdate(umID)
End Sub
End Class
Thanks in advance
Bhavya
I have created some vb scripts using Visual Studio 2019 and NX is installed in same machine. Dll or Exe runs fine.
Same dll or exe if I share to other machines and test in NX it is not working.
I guess something to do with Setting. Can someone help me on this.
Code for reference:
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.Annotations
Public Class NXOpenWinForm
Dim nx As Session
Dim nxpart As Part
Dim nxUI As UI
Dim nxexpressions As ExpressionCollection
Dim nxexpression As Expression
Public Shared Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = Session.LibraryUnloadOption.Immediately
End Function
Private Sub NXOpenWinForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
nx = Session.GetSession()
nxUI = UI.GetUI()
nxpart = nx.Parts.Work
nxexpressions = nxpart.Expressions
nxexpression = nxpart.FindObject("Length")
TextBox1.Text = nxexpression.Value
nxexpression = nxpart.FindObject("Width")
TextBox2.Text = nxexpression.Value
nxexpression = nxpart.FindObject("Height")
TextBox3.Text = nxexpression.Value
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
nxexpression = nxpart.FindObject("Length")
nxexpressions.Edit(nxexpression, TextBox1.Text)
nxexpression = nxpart.FindObject("Width")
nxexpressions.Edit(nxexpression, TextBox2.Text)
nxexpression = nxpart.FindObject("Height")
nxexpressions.Edit(nxexpression, TextBox3.Text)
Dim umID As Session.UndoMarkId = Nothing
nx.UpdateManager.DoUpdate(umID)
End Sub
End Class
Thanks in advance
Bhavya