Grip to assign part attr to assy files...
Grip to assign part attr to assy files...
(OP)
Howdies,
I need to open a native assy and assign 2 TC attributes (db_part_no & db_part_rev) by parsing the existing native part name/rev (providing for interactively changing the db attr if I don't like what's suggested). This is in preparation of totally crap legacy files for TC.
Essentially, I'd like to:
fully open the assy (in or out of NX)
parse existing part name and part rev into what will be the TC part_no & part_rev
accept the suggestion <or> change as desired
cycle to next part & repeat ...thru the entire assy structure.
Would anyone have something similiar they would be willing to share? ...or get me started?
TIA
I need to open a native assy and assign 2 TC attributes (db_part_no & db_part_rev) by parsing the existing native part name/rev (providing for interactively changing the db attr if I don't like what's suggested). This is in preparation of totally crap legacy files for TC.
Essentially, I'd like to:
fully open the assy (in or out of NX)
parse existing part name and part rev into what will be the TC part_no & part_rev
accept the suggestion <or> change as desired
cycle to next part & repeat ...thru the entire assy structure.
Would anyone have something similiar they would be willing to share? ...or get me started?
TIA
Regards,
SS
CAD should pay for itself, shouldn't it?





RE: Grip to assign part attr to assy files...
Use a premade clone file to import the assy into TCE using the part name, number and rev.
RE: Grip to assign part attr to assy files...
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Grip to assign part attr to assy files...
What format are your current part names / revisions in? Is there a common delimiter? How many quirky exceptions to the rule(s)? Do you expect to accept the default most of the time? If so, how about we just report what was done via a text file (or the output window) and you can inspect that and revise any individual files as needed; otherwise you will have to baby sit the program and click the OK button twice per part.
RE: Grip to assign part attr to assy files...
Theres the rub! On an 'as needed' bases, the plan is to pull legacy parts/assy into the db. Unfortunately, the naming conventions, delimiters, etc are all over the damn place. Some parts only have a descriptive name, not a part number. I/we expect to babysit the program as it goes thru so that's not a big deal...
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Grip to assign part attr to assy files...
RE: Grip to assign part attr to assy files...
Unfortunately, there has been no enforcement of the naming convention, and the delimiters can include underscored, dashes, or periods. ...and sometimes a mix!
It's been a while since I've written grip, but I'm willing to take a swing at it and I certainly don't expect the coding to be done for me.
Thanks again for the efforts!
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Grip to assign part attr to assy files...
I thought you would like to play around with this before I went too far in potentially the wrong direction.
Is this like what you had in mind?
RE: Grip to assign part attr to assy files...
RE: Grip to assign part attr to assy files...
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Grip to assign part attr to assy files...
It first checks to make sure that you actually have a part file open.
It then sets the Displayed part to be the Work part so that it starts at the top of the assembly structure.
It then checks to make sure that the TC attributes have not already been assigned. If either TC attribute has already been assigned to the Assembly file, it skips the assembly and moves to the next step. However, if the TC attributes do not exist, it reads the assembly file name and displays it in a dialog where you can either accept it as is or edit it to what you desire as well as entering a Revision Label. It then assigns the assembly part file the TC attributes using the values entered by the user as their values.
The program then cycles through the entire loaded assembly, including sub-assemblies, counting the number of components and then displaying that as a sort of sanity check.
It then cycles back and starts setting components, one at a time, to be the work part.
Again it checks to make sure that the TC attributes have not already been assigned. If either TC attribute has already been assigned to the Component file, it skips this component and moves to the next one. However, if the TC attributes do not exist, it reads the Component's file name and displays it in a dialog where you can either accept it as is or edit it to what you desire as well as entering a Revision Label. It then assigns the TC Part attributes using the values entered by the user as their values.
It then moves to the next component in the assembly until all component parts have been assigned the TC attributes based on the user's input.
At the end of the program it sets the displayed part back as the work part and then displays a message explaining that NONE of the modified files have been saved and that the user MUST do this manually by selecting the 'Save-All' command.
Anyway, give it shot and see if this meets your needs.
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Grip to assign part attr to assy files...
Good morning, and apologies for not responding sooner. I was 'out of the office' yesterday... As such, I haven't been able to look at or test either the journal or grip routine, but will do so today and report back. Thanks for the efforts regardless!
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Grip to assign part attr to assy files...
I've looked at both....
Cowski: The journal works nice so far... and is heading down the right direction. I will need to recursively hit all the sub assy/components, and the top level as well. In addition, we are planning to use the clone utility, and my guy is currently working w/our Siemens rep to generate a couple of bat files that will generate the clone log, and use that clone log for the import into TC.
John,
This is certainly heading down the right path! I like where it tries to recursively hit all sub-assemblies (sometimes 4 or 5 deep, with common components in a couple of different subassemblies), unfortunately it's giving a run time error at line 103 (setting the work part to the componant part: PARTOP/SET,work,COMPNAM). I haven't had time yet to dig into it yet though... Hopefully, after figuring out the fix for this, I'll be able to finish modifying the routine as needed.
I might add, our naming convention will typically be (depending on which part of the company generated the part):
1234567-rev.prt
1234567-rev_dwg.prt
proj&description-rev.prt
...and the dashes above, can be a 'dash', 'underscore', or 'period'. :-|
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Grip to assign part attr to assy files...
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Grip to assign part attr to assy files...
RE: Grip to assign part attr to assy files...
The error states: 'Error 154357 at line 103 in ASSIGN_PART_ATTRIBUTES. Solid modeler failure.' I've tried multiple assemblies w/different part names and continue to get the same error. I created a test assy of empty part files (no models) several layers deep, w/the same component in different parts all w/in the same top level assy. There were no errors, except for a different erros telling me a part wasn't opened (no biggie). In addition, I re-visited several of the assys where I got the error and interogated the models... examined geometry, part clean up, part playback... and I can't find anything wrong w/the files themselves. All of the assys are 'in date' and NX 6.0.3.6 did not try to update anything. I'm not sure where to go from here.
Unfortunately, I'll be out of the office all next week so it will be a week before I can revisit this thread. Rest assured though, I will be back. Thanks again for your time...
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Grip to assign part attr to assy files...
It seems to run fine (no buggies) but I did notice a couple of things...
1) If the same part is in multiple sub-assys, it re-writes the db_attr again. Is there a way to easily check for the attribute and display it if it exist (versus trying to parse it again from the convoluted pos part name)? ...which brings us to
2)It appears that the first instance of a delimiter it encounters is used to separate the name from the rev. Considering the way these files are named, using the last instance of a delimiter would be better (less typing and chance of error on the users part).
As I'm sure you've read in my reply to John, I'll be out of the office all next week and will be unable to test anything until I get back. However, if either you or John have any questions, please feel free to post em cause I will be reading this thread...
Thanks again...
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Grip to assign part attr to assy files...
RE: Grip to assign part attr to assy files...
RE: Grip to assign part attr to assy files...
I've floated your journal to the gents responsible for migrating the initial data and haven't heard back from them. I'll hit them up and find out what I can.
Thanks much for poking me, and I'll respond back as soon as I can.
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Grip to assign part attr to assy files...
My guys haven't said anything negative about it, and I've tested it myself and am very pleased! Thanks much for your time/efforts on this.
I'm still tweaking a grip routine to do much the same (based on John's grip, and more for my own knowledge than need...). But... since your journal is working so well we will likely just use that, since I'm also busy trying to put out fires....
thanks again!
Regards,
SS
CAD should pay for itself, shouldn't it?