×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Refile and add attribute

Refile and add attribute

Refile and add attribute

(OP)
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

RE: Refile and add attribute

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.

RE: Refile and add attribute

(OP)
Yes, we have a GRIP execute license.

Thank you...

Using NX 8 and TC9.1

RE: Refile and add attribute

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

RE: Refile and add attribute

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.

RE: Refile and add attribute

(OP)
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

RE: Refile and add attribute

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.

RE: Refile and add attribute

(OP)
Yes John,
it's correct.

Thank you...

Using NX 8 and TC9.1

RE: Refile and add attribute

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.

RE: Refile and add attribute

(OP)
John,
the grip program works perfect and rapid.

Thank you...

Using NX 8 and TC9.1

RE: Refile and add attribute

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources