Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to Journals, Macro User Entry Equivalent? 1

Status
Not open for further replies.

Buckshott00

Bioengineer
Aug 10, 2010
229
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
 
Replies continue below

Recommended for you

Attached is a pdf document which for totally new users in modifying journals may be of some help. This only gives an introduction to editing journals by showing the changes to a simple journal for creating an arc. The modifications decribed and shown in the modified journal include radius entry, centre point selection and journal flow control.

Hope this is of some help.

Frank Swinkels
 
 http://files.engineering.com/getfile.aspx?folder=9d642e58-5bc9-4e0b-a0b5-81d67d23d5b3&file=EditJournal.pdf
I think it is not very useful to record a journal to edit feature dimensions and then somehow make this journal useful. It is simpler to write the code. Below is a fairly simple program to edit the feature expressions.

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
 
Thank you Frank,

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor