Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Part Cleanup Macro

Status
Not open for further replies.

RAGudorf

Industrial
Jan 18, 2012
54
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
 
Replies continue below

Recommended for you

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
 
Another option is to customise your toolbar by adding the Part Cleanup command. This will make it more accessible.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor