test_convertexpressioninval.../Test_ConvertExpressionInValue/Test_ConvertExpressionInValue.vb
Hoeglinger Eugen 23e6a5966d Initialized
- Konvertiert eine Expressionvariable in einen Wert
2022-03-02 08:54:25 +01:00

49 lines
1.5 KiB
VB.net

Option Strict Off
Option Explicit On
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpen.Utilities
Module ConvertExpressionToValue
Dim s As Session = Session.GetSession()
' Explicit Activation
' This entry point is used to activate the application explicitly
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
Dim theUfSession As UFSession = UFSession.GetUFSession()
' TODO: Add your application code here
Dim dp As Part = s.Parts.Display
Dim exps() As Expression = dp.Expressions.ToArray()
For Each thisExp As Expression In exps
If thisExp.Type.ToString().Contains("Number") Then
dp.Expressions.Edit(thisExp, thisExp.Value().ToString())
End If
Next
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image when the NX session terminates
'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
'----Other unload options-------
'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
'Unloads the image explicitly, via an unload dialog
'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly
'-------------------------------
End Function
End Module