Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Greetings,
On Creo 4.0 M020
How do I write a relation in a for....?
I have an assembly with many parts. Some parts have different parameters than others. The information I need is in the files. Just called something different.
For example:
123.prt parameter = description_1
456.prt parameter = title_1
Instead of editing all files. I would like the assembly drawing bom relations to say something like:
asm_mbr_description_1 = asm_mbr_title_1.
I tried above. It changes the bom. But not the way I hoped for. I reversed it. Not what I wanted either. I basically want it to flag all "description_1"'s and have them show up in my "title_1" repeat region. So - substitution.
What is the proper way to write this.
Thanks,
Wayne
/* Put this is the repeat region relations. (You may have to manually add both of these parameter names to the parameters list at the bottom of the relations editor first.)
DESCR = ""
IF EXISTS("asm_mbr_title_1")
DESCR = asm_mbr_title_1
ELSE
IF EXISTS("asm_mbr_description_1")
DESCR = asm_mbr_description_1
ENDIF
ENDIF
Now change the repeat region parameter for that table cell to rpt.rel.DESCR
Note: I haven't actually tested this syntax in Creo, I just typed in directly in this response. There may be typos...
Tom, Not sure I follow:
"You may have to manually add both of these parameter names to the parameters list at the bottom of the relations editor first."
I did the other steps and I don't think it's complete?
If you verify the relations and they gripe, just manually add the parameters first. I just tested and it didn't gripe, so you should be okay.
No gripes here either.
But it's not showing up in bom.
Is attached correct?
Looks right... You did add it to the correct row, right? Can you upload the table as an attachment?
I put in description. Gotta bare with me. I only know enough to be dangerous with relations.
I have uploaded table. Nor sure if it is of value without parts?
I had to change extension for this to send. Please rename to .tbl.
Tx
Don't go crazy over this. I may just update the files as required just so they can be used again. But this is something good to know.
Tom's method should do what you need to solve the BOM issue.
What you really need to do is fix the start_part.prt template file so it has the proper parameter. Then all future files will have only 1 description parameter. Also educate your users as to which description parameter is the new valid one so they only use that one. If these are older files being saved-as, instruct the users to create the new parameter and cut and paste the old value to the new field, then delete the old parameter.
I don't use it (yet), but I believe Model/Check can automatically rename these old parameters when it encounters them...
Perhaps. We have it. But it may need to be set up for it. I am not that familiar with it. Have not used in some time. thanks again!
I hear you.
Well, what happened was this...
We contracted out work to be done entirely at another company. They did it their way. We are now partially redesigning and the new stuff we have used our standard parameters. So....we have a mixed bag. I am thinking of adding our parameters and leaving theirs. This way they can still have theirs present if we give them back files. technically they own the files. It's a CFk. If they ever used ours they'd have to add their 's in...lol.
Thanks Ben,
Wayne
Been there, done that!
Where I used to work, we sub-contracted a machine design to our corporate India subsidiary to design. Gave them instructions on what parameters to use, modeling standards, etc. When the shipped the design package back, we hade to spend about 5 hours per drawing to correct the parameter mistakes and modeling errors that were obvious. In the end we were not sure we saved anything on that project.
After that we brought the India engineers to the US for a six-nine month in-house 'training' session to learn better how we did our designs and learn how to use our software add-on tools.
yup. but...I have a lot less say. LOL.