
#Ug nx 8.5 tutorial code
It is important to note that these statements do not add more functionality to your code (ie they are not analogous to references to external libraries) rather they allow certain declarations to be abbreviated. Next up are the Imports statements, which import a specified namespace. Option Strict Off means the code will allow some types of implicit conversions, but really it isn’t something we’ll need to worry about right now. Dispose ( ) ' - ' Menu: Tools->Journal->Stop Recording ' - End Sub End Module FindObject ( "BLOCK(0)" ), Body )ĭisplayModification1. NewColor = 103 Dim objects1 ( 0 ) As DisplayableObjectĭim body1 As Body = CType (workPart.

ApplyToOwningParts = FalseĭisplayModification1. ApplyToAllFaces = FalseĭisplayModification1. NewDisplayModification ( )ĭisplayModification1. Visible, "Edit Object Display" ) Dim displayModification1 As DisplayModificationĭisplayModification1 = theSession. DeleteUndoMark (markId1, Nothing ) ' - ' Dialog Begin Edit Object Display ' - ' - ' Dialog Begin Color ' - Dim markId3 As Session. SetUndoMarkName (markId1, "Class Selection" ) SetUndoMarkName (markId1, "Class Selection Dialog" ) Dim markId2 As Session. Display ' - ' Menu: Edit->Object Display. Work Dim displayPart As Part = theSession. GetSession ( ) Dim workPart As Part = theSession. I created a new file and inserted a block feature, then followed the steps outlined above here is the resulting journal code:ĭim theSession As Session = Session. Don’t worry if this looks like mumbo jumbo right now, we’ll step through it to see what is going on.
#Ug nx 8.5 tutorial windows
Open a Windows file explorer window and browse to your new journal file, open it with a text editor (such as notepad) and take a peek at what goes on behind the scenes. After a short pause, your solid body will change to the color you picked when you recorded the journal. Select your journal from the list and press the Playbutton. Change the color of the solid body, or perform an Undo to get the original color back now navigate to Tools -> Journal -> Play. OK the changes and then stop the journal recording Tools -> Journal -> Stop recording.

from the menu, pick the solid body of interest, and pick a new display color. Now that recording is under way, choose Edit -> Object Display. The green marks on the toolbar icons/menu items indicate that journal recording is fully supported by this command yellow marks indicate the command is partially supported. Once the journal recording process starts, you may notice a change in your toolbars and menus. and specify a file name for your new journal, preferably something that describes its function such as “change_color.vb”.


Start by recording a journal Tools -> Journal -> Record. on the Journaltab choose Visual Basic as the language and make sure the Insert Menu/Dialog Box Commentsoption is checked.įor starters, let’s assume you want to change the color of a specified solid body. In the menu, choose Preferences -> User Interface. Setting the Journal Programming Language: If you are following along, let’s make sure the journal output language is set to VB before we start. This wonder of modern technology will translate your interactions with NX to journal code, in your language of choice! (this article will use Visual Basic, or VB for short). Where to start? The best place to start writing a journal is with the journal recorder. (menu locations in this tutorial are based on NX 7.5, programming language is Visual Basic)
