×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

New to Journals, Macro User Entry Equivalent?

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

RE: New to Journals, Macro User Entry Equivalent?

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

RE: New to Journals, Macro User Entry Equivalent?

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

RE: New to Journals, Macro User Entry Equivalent?

(OP)
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
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources