Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

create assembly of assemblies via text file, Journal

Status
Not open for further replies.

CR98

Mechanical
Jul 15, 2018
5
Hi,

Running NX10 native.

I'm using the code from the dropbox link found in I've changed a few things regarding where it gets the file, but all functions have remained the same.

I've got a number of assemblies created, and a text file showing how they relate (think motorcycle, with an assembly for the ignition, engine, etc.) on my computer it's set up so there's a "motorcycle" folder containing folders inside for each additional assembly. Selecting the "motorcycle" folder as the main part folder (one of the first lines in the code), NX seems to find the top level part of each additional assembly contained in the sub folders (if I try to open the new one and the original one it will say a newer version is open), however none of its sub-components are added, just the top level part. The only way around this I've found is to open the assemblies prior to running the code, which brings up the question of how useful the Journal would be.
How can I can get NX to bring in all the parts associated with the top level part, being called out in the text file?

Another question I have is this: most, but not all, top level parts follow the naming of "pn ##### description" the number is usually 4-5 digits, but varies. Rather than making sure the name of the part and one the on the text file match completely, could I simply call out the number and have NX grab the part that matches, when applicable? The numbers are unique and only the top level parts have them, so duplicates shouldn't be an issue.

Thanks master Journalers!
 
Replies continue below

Recommended for you

The code in the dropbox link was written for Nham's particular situation:
Nham said:
Assuming that all child parts are in the same directory...

It sounds like you have multiple subdirectories instead of a single directory; you'll need to modify the journal to handle this situation. The journal first looks at the parts in session before looking in the folder specified; that's why it somewhat works when you load the parts first.

Matching on a partial part name is also possible, but not handled in this version of the journal.

In short, the journal was made for a particular situation, you'll need to modify the journal to meet your needs.

www.nxjournaling.com
 
Cowski,

Thank you for your quick response. I thought that it might be able to grab the other parts since they were in the same main folder, but what you said makes much more sense. I tried adding "..." to the directory to search subsequent folders, but that didn't work, I imagine it was looking for a folder with that name. Would it be easier to modify the code to take "..." into account, or add a function to search sub folders and call that out when checking if the parts exist?

As far as partial matches, I imagine the best way to do that would be some sort of if statement and turning the number into a string and finding a match for it, but I'm open to suggestions.

Thanks again,

CR98
 
Would someone be able to point me in the right direction getting started with having it search sub directories? I'm not the most experienced with VB, and haven't had much luck with it, even just finding where the part folder is being defined as the only directory searched.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor