Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Refile and add attribute

Status
Not open for further replies.

cubalibre000

Mechanical
Joined
Jan 27, 2006
Messages
1,070
Location
IT
Hi,
Refile process is fast, so I ask if during this process it's possible to add an attribute like 'Code'= file part name.
If not, exist a tool that work fast and at very low level.
This because I've 200000 file.

Thank you...

Using NX 8 and TC9.1
 
Refile won't do that, but you could write a simple program which would open a part file, write a Part Attribute with the value equal to the name of the part file, save and close the file and go to the next file in the folder, repeating until completed. It won't be as fast as refile, and with 2000000 files, depending on their size, it might have to run overnight.

BTW, do you have a GRIP execute license?

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.
 
Yes, we have a GRIP execute license.

Thank you...

Using NX 8 and TC9.1
 
That would be a very simple GRIP program.
I may have some code lying around, but I don't have NX here.
Do you have GRIP develop, too?
I won't be back in the office until Wednesday.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
OK, attached is a GRIP program which will start in a user-specified folder and will Open all the Part files in that folder as well as all sub-folders, and will add a Part Attribute named 'Code' with the value set equal to the Name of the Part File. It will then save and Close the Part File and move to the next file until all Part Files have been updated.

Note that you MUST run this program from Gateway with NO Part files open. Also you MUST first set the Assembly Load Options so that the 'Structure Only' is loaded and that the 'Load Interpart Data' option is toggled OFF.

When you execute the program you will be asked to enter the full path of the start folder (do NOT end the path with a '\'). After the last file has been updated, you will be asked if you wish to end the program or enter another start folder.


The above instructions are also included in the program's Source file.

I would suggest that you test this on a duplicate folder with a few sample part files so that you can verify that this is doing what you expect it to do.

Anyway, have fun. As before, after downloading the file, edit the extension changing it from '.zipper' to '.zip' before extracting the files.

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=f0541e08-40ce-4d8e-9ba0-7fee9f7fd235&file=Add_DATA_Attribute_to_Part_File.zipper
Hi John,
thank you for the support and the code that works as descrived.
I've two corrections to ask you.
1) The 'Code' begin 'Codice'
2) The 'file name' used to compile the 'Codice' attribute is without extension (.prt).

Thank you in advance.

Thank you...

Using NX 8 and TC9.1
 
Let me get this clear, you want the name of the attribute changed from 'Code' to 'Codice', and you want the part file names to NOT include the '.prt' extension, correct?

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.
 
Yes John,
it's correct.

Thank you...

Using NX 8 and TC9.1
 
OK, attached is the revised version of the program. I changed the Part Attribute name from 'Code' to 'Codice' and the Part File names saved in the part attribute no longer has the '.prt' extension. Anyway, give it a test and let me know if it's what you needed.

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=e51a0bc8-dcc8-4235-8772-d01cbce95a31&file=Add_DATA_Attribute_to_Part_File.zipper
John,
the grip program works perfect and rapid.

Thank you...

Using NX 8 and TC9.1
 
Glad to hear that.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top