Zoes
Mechanical
- Sep 30, 2011
- 46
Hi all,
I have written the code bellow but while trying to execute it gives me an error message: "Error in the external library. See syslog for details ... Function name ufusr".
The form is supposed to load the existing expressions of breadth and thickness and assign them to two textboxes expression0 and experssion01.
Does anybody knows how to fix this?
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports System.Windows.Forms
Public Class Form1
Private Shared theSession As Session
Private Shared theUI As UI
Public nErrs1 As Integer
Public id1 As Session.UndoMarkId
Public workPart As Part = theSession.Parts.Work
Public displayPart As Part = theSession.Parts.Display
Dim nxopenSession As NXOpen.UF.UFSession
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
nxopenSession = NXOpen.UF.UFSession.GetUFSession()
'MeesageWindow
Dim MessageBoxTitle As String = "Track Expression"
'Find Expressions
Dim breadthExp As Expression = CType(theSession.Parts.Work.Expressions.FindObject("Breadth"), Expression)
Dim thicknessExp As Expression = CType(theSession.Parts.Work.Expressions.FindObject("thickness"), Expression)
'Convert Expressions' Values to Strings
Dim breadth As String = breadthExp.Value.ToString
Dim thickness As String = thicknessExp.Value.ToString
If breadthExp IsNot Nothing Then
expression0.Text = breadth
expression01.Text = thickness
If (breadth = 25 And thickness = 6) Then
theUI.NXMessageBox.Show(MessageBoxTitle, NXMessageBox.DialogType.Information, "yeah")
End If
'Force Update and redraw part
nErrs1 = theSession.UpdateManager.DoUpdate(id1)
End If
End Sub
Private Sub Apply_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Apply_btn.Click
'Force Update and redraw part
nErrs1 = theSession.UpdateManager.DoUpdate(id1)
End Sub
End Class
I have written the code bellow but while trying to execute it gives me an error message: "Error in the external library. See syslog for details ... Function name ufusr".
The form is supposed to load the existing expressions of breadth and thickness and assign them to two textboxes expression0 and experssion01.
Does anybody knows how to fix this?
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports System.Windows.Forms
Public Class Form1
Private Shared theSession As Session
Private Shared theUI As UI
Public nErrs1 As Integer
Public id1 As Session.UndoMarkId
Public workPart As Part = theSession.Parts.Work
Public displayPart As Part = theSession.Parts.Display
Dim nxopenSession As NXOpen.UF.UFSession
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
nxopenSession = NXOpen.UF.UFSession.GetUFSession()
'MeesageWindow
Dim MessageBoxTitle As String = "Track Expression"
'Find Expressions
Dim breadthExp As Expression = CType(theSession.Parts.Work.Expressions.FindObject("Breadth"), Expression)
Dim thicknessExp As Expression = CType(theSession.Parts.Work.Expressions.FindObject("thickness"), Expression)
'Convert Expressions' Values to Strings
Dim breadth As String = breadthExp.Value.ToString
Dim thickness As String = thicknessExp.Value.ToString
If breadthExp IsNot Nothing Then
expression0.Text = breadth
expression01.Text = thickness
If (breadth = 25 And thickness = 6) Then
theUI.NXMessageBox.Show(MessageBoxTitle, NXMessageBox.DialogType.Information, "yeah")
End If
'Force Update and redraw part
nErrs1 = theSession.UpdateManager.DoUpdate(id1)
End If
End Sub
Private Sub Apply_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Apply_btn.Click
'Force Update and redraw part
nErrs1 = theSession.UpdateManager.DoUpdate(id1)
End Sub
End Class