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!

NX - have the file name as a part attribute or string expression 2

Status
Not open for further replies.

UNIFORMSRL

Mechanical
Mar 19, 2009
21
0
0
IT
Hi all,

is it possibile to extract the file name of an NX file and store it as a string expression or a part attribute?

Thanks a lot!
 
Replies continue below

Recommended for you

It could be done with a grip or journal, but it would not be associative to the filename. What are you trying to achieve?

Chris T.
Project Design Analyst
Kohler Co. Engine Division
Using NX6
 
We manufacture tools and molds, we use Moldwizard and we are installing a new ERP.
What I would like to achieve is to have an unique part code associated to each component we produce internally from scratch.
The code I was thinking about is done like these "xxxxxx yyy zzz ttt" where:
xxxxxx is the unique code of the project,
yyy the family code,
zzz the sub-family code,
ttt the part code.
Since I would like this code to be automatically generated by NX, I was thinking about extracting the last 3 digits of the file name, which are randomly defined by Moldwizard when the part is input.
I think it is not important that the code is associative, I just need it to be generated at the beginning.
 
OK, that makes sense. I will try to create a simple grip program for you this afternoon.

Chris T.
Project Design Analyst
Kohler Co. Engine Division
Using NX6
 
Attached is a very simple grip program that will capture the name of the current file and add it to a part attribute titled "Filename"

This is a very generic program, but it should be pretty easy to customized to meet your needs.

Chris T.
Project Design Analyst
Kohler Co. Engine Division
Using NX6
 
 http://files.engineering.com/getfile.aspx?folder=6f754c46-92bc-4215-bc02-df21b64cbe12&file=assign_filename_to_attribute.zip
Hi wiengines,
Is it possible for a grip to extract the last three digits of the file name then create & add it to an attribute named "DETAIL NUMBER" ?

Thanks,
James
NX7.5
 
Attached is a GRIP program which will extract the last 3 characters of the name portion of a part file name and create a Part Attribute named 'DETAIL NUMBER' with these characters as it's value.

After downloading the file, edit the file extension from .zipper to .zip before extracting the files.

Have fun, and let me know if this is what you were looking for.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
 http://files.engineering.com/getfile.aspx?folder=afb9998e-eeae-4cdc-8ff2-5d5fe358f052&file=assign_part_name_detail_number_attr.zipper
Thank you very much Mr. Baker. That worked like a champ. Man that's service!

Do you have a grip (or anything else) that will create & fill out a "QTY" attribute for every component in an NX7.5 assembly?

James
 
Hi cowski,
We do use the parts list for our "bill of material" but the shop wants the quantity in the detail drawing's title block as well.

Jmaes
 
How are you going to handle the situation where the same "detail" part is used in more than one Assembly with the possibility that the quantity could be different in one Assembly versus another?

BTW, I think it's feasible to develop a GRIP program which would assign a 'QTY' attribute to the Components of an Assembly. However, those attributes would NOT be seen at the piece part level. They would be assigned to the Component objects which are contained and saved in the Assembly itself. In other words, these attributes would be 'local' content only. If you query the 'Properties' of the Component in the context of the Assembly, the attribute would be there, but if you opened the Master Model of that Component as it's own Work Part and open the File -> Properties -> Attributes dialog you would NOT see this attribute.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
We wouldn't use this QTY program until the end of the design. By that time all components except fasteners are in this unique job folder with their own file name & detail # & wouldn't be a component in another design. The fasteners are family member files which cannot be written to. The QTY program would need to be able skip over family member & read only files & continue on.

This QTY program would be ran from the upper most parent assembly file, the main design file, which has no geometry just components. It would give the quantity of the components in this main assembly. It would need to write this QTY attribute in the sub-components not in the main assembly. If you opened only one of the components by itself you'd need to see this attribute. If it could write to files ending in three numbers only & not write to files ending letters that's be even better but not necessary.

Thanks,
James
 
Status
Not open for further replies.
Back
Top