Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Switch Part tool 4

Status
Not open for further replies.
CNSZU,
Thanks for offering us the use of your great journal.
I've got it working fine, except, i work with large assemblies, up to 1000 parts. when the list comes up, it fills the screen from top to bottom, in alphabetical order as far as it can, but if i try to scroll down the list by picking the small down arrow at the bottom, it seems to slip off the end of the list, scroll wheel and arrow keys dont help either. Is there a way to go lower down the list?
Thanks
 
and something else i noticed...
If i don't have many things in session, i get an arrow next to the sub-assemblies, but when i have a massive session open, it doesn't show the expand arrows on the sub assemblies.....maybe its to do with memory??
 
Hi moog, yes, I noticed that too with the up/down arrows not working, I'll fix that ASAP. About your second point, do you mean that you have one huge assembly where the top level part doesn't show the expand arrow? If we use the preview image on the opening post of this thread as an example, and we assume that A_Assy contains a huge number of parts and that A_Assy doesn't show the expand arrow? Roughly how many parts is in the assembly? It's a bit difficult for me to fix something like this because I don't have a big assembly to test with, but I'll try.

NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000
 
CNSZU,
My assembly has 3800 parts, the top level, has about 20 assemblies, and then inside those there are single parts, as well as more sub-assemblies, and sub-sub-assemblies.
The top level has the arrow, and i can expand to see the next layer, but most of those are assemblies, which don't have arrows, and so can't be expanded any further.
I loaded an assembly structure with only 800 parts, and what it seems to do is list firstly the sub assemblies, then the single parts (within them, in alphabetical order, until it reaches the bottom of the screen, again, none of those sub-assemblies can be expanded
 
Here is a new version 1.1 of the NX Switch Part tool.

-parts are now listed in a tree structure
-all parts are now listed (suppressed and unloaded parts are included)
-all parts are listed exactly the same way as in the Assembly Navigator
-up/down arrows are fixed

HOW TO INSTALL:
download the attached "NXSwitchPart_1_1.rar" and extract
place the vb (journal) and bmp files together in a folder
in NX: Customize ...> New User Command. With the new button, set Default style. Edit Action: Type: Journal File, browse to the vb file.
Change button image > image name. browse to the Window_sc.bmp file.
Replace the path in the beginning of the journal file with the folder with the journal file and bmp files.

If there are any issues, let me know.

PREVIEW IMAGE:
ICON & JOURNAL FILES:
NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000
 
Hi Didier, I appreciate your warm comments, it made it worthwhile for me to make this tool! Hopefully it will be useful to you. If you have any suggestions, let me know.

NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000
 
Hi moog, open the 3800 part assembly (don't open other separate assemblies), run the attached journal file, wait for the listing window to finish and the tool window to appear. Then, without moving the mouse over the tool window parts, close the window, save the listing window to a file, then upload the file here for me to check.

Also, I've noticed that there is a bug where the tool stops working in the "No Part" application (but still are parts in the session). I'll fix this in the next version.

If people have a wish list for extra functionality I'll try to incorporate that too.

NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000
 
 http://files.engineering.com/getfile.aspx?folder=cab0a6f4-0991-498d-8d92-c1058cc1ffe4&file=NXSwitchPart_1_1_DEBUG.rar
CNSZU,

Thank you for creating the Switch Part Tool journal. I have an enhancement request for the utility. Is there a way to have the journal script give a PACKED parts list to show only one occurrence of a part/assembly within each sub-assembly presented in the dialogs?

Thank you

NxPerson

NX852/Teamcenter 8.3.3.5
 
Hi NXPERSON,
I guess you mean by "packed" listing where in NX you right click the Assembly Navigator and choose Pack All? This is doable.
Actually, version 1.0 has an even more compact listing where ALL duplicates are removed from the listing (presented in a flat structure). Also, unopened/suppressed parts are not listed.
I'll create a settings dialog to select how the listing is presented (full/packed/no duplicates).

NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000
 
Hi CNSZU,
very intersting tool.
It's possible implement the journ to add a custom attribute in the tree, this because the code or part number is not enough clear.

Thank you...

Using NX 8 and TC9.1
 
Hi CNZSU,
I'm running into compiling issues (v1.1, NX7.5):
Line 611: AddHandler newContextMenuStrip.Opening, AddressOf newContextMenuStrip_Opening
Line 613: AddHandler newContextMenuStrip.Closing, AddressOf newContextMenuStrip_Closing
Line 614: AddHandler newContextMenuStrip.Closed, AddressOf newContextMenuStrip_Closed

Errors from NX log:
Line 611: Method 'Public Sub newContextMenuStrip_Opening(sender As Object, e As System.EventArgs)' does not have the same signature as delegate 'Delegate Sub CancelEventHandler(sender As Object, e As System.ComponentModel.CancelEventArgs)'.
Line 613: Method 'Public Sub newContextMenuStrip_Closing(sender As Object, e As System.EventArgs)' does not have the same signature as delegate 'Delegate Sub ToolStripDropDownClosingEventHandler(sender As Object, e As System.Windows.Forms.ToolStripDropDownClosingEventArgs)'.
Line 614: Method 'Public Sub newContextMenuStrip_Closed(sender As Object, e As System.EventArgs)' does not have the same signature as delegate 'Delegate Sub ToolStripDropDownClosedEventHandler(sender As Object, e As System.Windows.Forms.ToolStripDropDownClosedEventArgs)'.

If I comment these lines the script seems to work. What do these lines actually do? Does this have anything to do with my version of NX or the .net framework?
 
moog2: The last line in your debug file is "ERROR 9: C:\open_part.bmp". This means that the tool can't find the bmp files. Please change the path line in the debug journal file to point to the bmp files, then run the debug version journal again.

Cubalibre00: Do you mean to have a custom attribute to appear together with the part name in the Switch Part tool listing? This sounds like a very cool idea, I will look into it.

cowski: No, no, it's my pleasure. I'd be delighted if I can help people work more efficiently and enjoyable with this great program that is NX.

MartijnH: I think it's to do with your version of NX. It seems the compiler might be more fussy than in 8.5. And yes, those lines of code have no effect on the program, they were originally used for debugging.

NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000
 
Hi CNSZU,
yes, I mean to have a custom attribute to appear together with the part name in the Switch Part tool listing.
It's possible to have an input box at the top of the mask that filter or/and search trough the word entered ?



Thank you...

Using NX 8 and TC9.1
 
CNSZU,
Here's a proper version of the debug window, you asked for..... Except, i DO get the proper final window with this debug version, and it seems to work a bit quicker as well (unless its because i have something to watch while its doing its thing).
But as i hover over the icons in the window, it shows the images, but it vanishes if i try to follow one of the sub-assemblies across, or move more than half way down the list.
And the last debug line then reads.... "ERROR 9: Error creating window handle."
 
 http://files.engineering.com/getfile.aspx?folder=4919dbe9-0e43-4566-a2c3-9ee912a92e5c&file=debug2.txt
CNSZU,

Yes I would like to see the packed assembly as you have stated with an options dialog.

I have an issue when switching from a part while in the manufacturing application to a part that does not contain any manufacturing data. The part switches in NX, then the Manufacturing Environment dialog opens asking to create manufacturing setup in the switched to part. Now both the Manufacturing Environment and the Switch Part dialog boxes are both open. The only option that I have is to use task manager to close NX and to restart the software. It appears that the Switch Part tool dialogs need to be closed before the part is changed.

When switching from one part with manufacturing data to another part with manufacturing data, the Switch Part utility works as designed.

Thanks for your time with this utility to help the NX community. Looking forward to the next release of the utility.

NxPerson

NX852/Teamcenter 8.3.3.5
 
Finally, here is version 1.2 of the NX Switch Part tool which includes all feature enhancements and bug fixes requested by the posters.

Among the highlights, now it's possible to control the display of parts with attribute values as well as search against criteria such as part name, attribute and part state.

Version 1.2 change log:

Added options dialog box
Added option for packed/full listing
Addded option for item text (part name and up to 3 attribute values)
Added search dialog box
Added search option for part states (open, suppressed, closed, hidden)
Added search option for part name and attributes
Added method to open displayed part in Windows Explorer
Added statusbar with option to change listing view between Standard and Search
Added tooltips to show full path for each part
Added bold font for current display part
Faster startup time for large assemblies
Fixed bug where the tool would freeze for large assemblies (thousands of parts)
Fixed bug where the tool freezes in No Part mode
Fixed bug where some assemblies would get mixed up when multiple separate assemblies are open
Fixed bug where NX would freeze when switching to a non-manufacturing part in the Manufacturing application

Notes:
A file containing options will automatically be created in the path set in the journal file.
Access the menu by right-clicking anywhere in the window.
The options applies to both Standard List and Search List.
The tool might freeze when searching large assemblies where the search results in thousands of parts. Moog2, please test for me!
Tested with NX 8.5 native, Win 7 SP1, .NET framework 4.5

HOW TO INSTALL:
Download the attached "NXSwitchPart_1_2.rar" and extract (keep all files together in the same folder)
In NX: Customize ...> New User Command. With the new button, set Default style. Edit Action: Type: Journal File, browse to the vb file.
Change button image > image name. Browse to the Window_sc.bmp file.
Use notepad to replace the path in the beginning of the journal (vb) file with the folder with the journal file and image files.

As always, if there are bugs or feature requests, let me know:)

PREVIEW IMAGE:
ICON & JOURNAL FILES:

NX8.5 Win7SP1 64bit i7-3770K@4.3Ghz 16GB Quadro2000
 
Status
Not open for further replies.
Back
Top