×
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

Part Cleanup Macro

Part Cleanup Macro

Part Cleanup Macro

(OP)
We deal with a lot of foreign data in NX and we have a nagging problem. When we cross over the imported solid with a mouse cursor, the model becomes highlighted in a reddish orange and does not go away. Someone pointed me to a command under File-Utilities-Part Cleanup..Remove Extraneous Highlighting check box. This command does the trick every time but is a buried command and to many clicks away.

I recorded a macro and assigned it to a button which works fine only the part that the macro was created against. Every other part I try to run this macro with throws up and error which can be cleared, but takes another two mouse clicks to remove the highlighting.

Does anyone have a working macro for this or any idea what I can do to make this macro "generic" across all part files?

Here is the error "Macro Out of Sync...Error at line number 60. Playback terminated. A dialog item recorded in the macro is causing a problem. Has the macro been played back from a different state? Has the dialog been modified?"

Line 60 in a text editor is a follows...OK -10 0 ! OK Callback
but who know where it starts counting.

Thanks,
Ryan

--
Ryan Gudorf
CAD/CAM Supervisor
Budde Sheet Metal Works, Inc.
305 Leo St.
Dayton, Ohio, U.S.A. 45404
Tel: 937.224.0868
Fax: 937.224.1356
http://www.buddesheetmetal.com

RE: Part Cleanup Macro

What version of NX?
Try recording a journal, the following was created on NX 8.

CODE

' NX 8.0.3.4

Option Strict Off
Imports System
Imports NXOpen

Module NXJournal
Sub Main

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work

Dim displayPart As Part = theSession.Parts.Display

' ----------------------------------------------
'   Menu: File->Utilities->Part Cleanup...
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")

theSession.SetUndoMarkName(markId1, "Part Cleanup Dialog")

Dim markId2 As Session.UndoMarkId
markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Part Cleanup")

Dim partCleanup1 As PartCleanup
partCleanup1 = theSession.NewPartCleanup()

partCleanup1.TurnOffHighlighting = True

partCleanup1.DoCleanup()

partCleanup1.Dispose()
theSession.DeleteUndoMark(markId2, Nothing)

theSession.SetUndoMarkName(markId1, "Part Cleanup")

' ----------------------------------------------
'   Menu: Tools->Journal->Stop Recording
' ----------------------------------------------

End Sub
End Module 

www.nxjournaling.com

RE: Part Cleanup Macro

Another option is to customise your toolbar by adding the Part Cleanup command. This will make it more accessible.

RE: Part Cleanup Macro

(OP)
Cowski,
The journal seems to have done the trick.

Thanks,
Ryan

--
Ryan Gudorf
CAD/CAM Supervisor
Budde Sheet Metal Works, Inc.
305 Leo St.
Dayton, Ohio, U.S.A. 45404
Tel: 937.224.0868
Fax: 937.224.1356
http://www.buddesheetmetal.com

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