Blockstyler tree list example

The following code sample (NX 11) was submitted by member GZN. This is an example of using the blockstyler tree list control. When run on an assembly, it will list all the assembly components in the tree list. After selecting one or more rows in the tree list, press OK and the selected rows will be exported to an HTML file.

The sample makes use of the TreeListDemo.dlx file found in the sample applications that ship with NX; be sure to modify the code to point to the location of this file on your machine before running the journal.

Thanks GZN for sharing your code!

Reposition component to another selected component

Below is a journal submitted by kam; the code will reposition a selected component. Here is the description from the journal header:

Reposition a component.

The journal repositions the selected component to the position of another selected component.

If the selected component is a member of a subassembly,
not only the selected component but the whole subassembly is repositioned.

If the two selected components are the same,
the component is repositioned to the origin of the displayed part.

NX 11. Written in c#.
2018-8-5

Drafting Iso view

The journal below was submitted by user kam; it creates an isometric drafting view based on a selected view and a selected location. It allows you to quickly create an iso view with only a couple of clicks. The code should be run from the drafting application; there needs to be a drawing sheet with at least one view. When run, the journal will prompt you to select an existing view to use as the starting point of the isometric view.

Reset Component Position

Reset Component Position

When working with assembly files, moving components around in space, there may come a time when you want to reset a component to its absolute starting point; the position where it would appear when adding it with the "absolute position" option. There are various work-arounds in NX to get a component back to its absolute position, but out-of-the-box there is no one click solution - we'll have to make our own.

NXOpen.Features.Feature and the Feature Collection

In the NXOpen API, the "part" object is among the most used and most useful to the programmer. The part object gives us access to dozens (hundreds?) of properties and collections of other objects that we can use to query and modify the part. Let's take a look at the NXOpen.Feature object and the {part}.Features collection.

Pages