New to Journals, Macro User Entry Equivalent?
New to Journals, Macro User Entry Equivalent?
(OP)
Hello,
Running Windows XP Pro 32Bit NX 7.5.3
I'm just starting using Journals as opposed to macros, and I want to be able to edit a dimension from a dialog box like I would do with a macro.
In a macro I would select the feature, then the dialog box would come up, and I would insert User Entry or User entry with instructions.
What is the equivalent within a Journal? If I have to enter code to get it to do this, can someone give me an example of it?
Thanks
Running Windows XP Pro 32Bit NX 7.5.3
I'm just starting using Journals as opposed to macros, and I want to be able to edit a dimension from a dialog box like I would do with a macro.
In a macro I would select the feature, then the dialog box would come up, and I would insert User Entry or User entry with instructions.
What is the equivalent within a Journal? If I have to enter code to get it to do this, can someone give me an example of it?
Thanks





RE: New to Journals, Macro User Entry Equivalent?
Hope this is of some help.
Frank Swinkels
RE: New to Journals, Macro User Entry Equivalent?
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Imports NXOpen.Features
Imports NXOpen.Utilities
Module EditFeature1
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim ui As UI = UI.GetUI()
Sub Main()
Dim response As Selection.Response
Dim feat As Feature = Nothing
Dim exp As Expression = Nothing
Dim noExps As Integer = Nothing
Dim expdescstrings(-1) As String
Dim exptags(-1) As Tag
Dim expValue As String
Dim expTitle As String
Dim expvaluenew As Double
Dim nErrs1 As Integer
Dim id1 As Session.UndoMarkId
Start1:
response = select_feature(feat)
If response = Selection.Response.Cancel Then GoTo End1
ufs.Modl.AskExpDescOfFeat(feat.Tag, noExps, expdescstrings, _
exptags)
For i As Integer = 0 To noExps - 1
exp = NXObjectManager.Get(exptags(i))
expValue = exp.RightHandSide
expTitle = exp.Name
Try
expvaluenew = NXInputBox.GetInputNumber("Enter Exp Value", _
expTitle & " = " & expValue, _
expValue.ToString)
exp.RightHandSide = expvaluenew.ToString
Catch ex As Exception
GoTo Continue1
End Try
Next
Continue1:
nErrs1 = theSession.UpdateManager.DoUpdate(id1)
GoTo Start1
End1:
End Sub
Public Function select_feature(ByRef feat As Feature) As Selection.Response
Dim selobj As NXObject = Nothing
Dim cursor As Point3d
Dim typeArray() As Selection.SelectionType = _
{Selection.SelectionType.Features}
Dim resp As Selection.Response = _
ui.SelectionManager.SelectObject("Select feature", _
"Select feature", Selection.SelectionScope.WorkPart, _
False, typeArray, selobj, cursor)
If ((resp = Selection.Response.ObjectSelected) _
OrElse (resp = Selection.Response.ObjectSelectedByName)) Then
feat = CType(selobj, Feature)
Return Selection.Response.Ok
Else
Return Selection.Response.Cancel
End If
End Function
End Module
Hope this helps
Frank Swinkels
RE: New to Journals, Macro User Entry Equivalent?
I am looking thru this, but so far, that 2nd post is very useful. I want to create some journals that rely only on the user entering in dimensions of a few critical dimensions
Thanks again