Overlay Graphics

Do you need to allow the user to select a screen position? Would you like to provide some feedback as they move the cursor around the screen?
If so, the SpecifyScreenPosition function and the overlay graphics primitives are just what you need. The SpecifyScreenPosition function allows you to define a "motion callback function" that will be called each time a mouse movement is detected. If you have created any Windows forms applications, this would be very similar to the MouseMove event. The motion callback works with Overlay Graphics Primitives (OGP) to allow for some cool graphical effects that are very useful for user feedback. Think about using a selection rectangle or lasso in NX; there is visual feedback regarding the size and position of the selection method, but they are just temporary objects - you don't end up with four new lines in your part file each time you use a selection rectangle.

Export Assembly to Excel with pictures

Below is a journal taken from the forums that I believe deserves more exposure, it was submitted by user ian.eldred. The journal analyzes the assembly structure and exports a BOM to Excel. A small thumbnail picture of each component is added next to the corresponding entry and the assembly hierarchy is visually represented by Excel groups that you can expand/collapse as desired. The resulting Excel BOM is both useful and visually pleasing. It is a great example of working with Excel in journal code. From ian.eldred:

I wanted to share my first attempt at a Journal file. This Journal is based on the assembly recursion example on this site, but adds in an export to excel with screenshot images. The screenshots are cropped and re-sized to keep the excel file size small. It would be great if others could try it out and let me know if it works on other systems. Please post comments below. Ian

Report Weld Points

In a recent forum thread, the topic of weld points came up; those working with the weld points were looking for an easy way to highlight and differentiate the different weld point types. The journal code below performs the following actions:

  • Create a small colored sphere on each weld point; two-thickness welds will be colored green, three-thickness welds will be colored red.
  • A fixed datum axis is created according to the weld vector.
  • The sphere and datum axis features are renamed to match the weld point ID.
  • The weld point ID, location, weld vector, and number of sheets welded are all output to the information window.

Wrangling the WCS

Having a working coordinate system (WCS) that can easily be moved around makes life easier for the designer. Choosing a convenient coordinate system and entering values directly is much simpler than transforming all the desired coordinates into the absolute coordinate system (ACS). The benefits of having a WCS are not only for the designers using interactive NX, programmers can also use the WCS to make their lives easier too.