Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Is there a way to sort a table by a function based on a part name?
I have a parts lists which is generated using repeat region tables. I need to sort the entries so that those which are designed items and having a name length of 13 characters appear first and then the purchased parts (e.g. screws, handles etc) which have a 7 digit name length appear afterwards. Any file which doesn't have a 7 or 13 character file name is a dummy part/asm and would be manually filtered out, unless I can find a way of automating that as well.
&asm.mbr.name
42345-0001-00
42345-0002-00
42355-0001-00
22-3456
23-2345
34-9865
Designed parts always start with a 4 and stock parts start with a 2 or 3 so the default sort option of "&asm.mbr.name forward" lists parts in the wrong order.
Solved! Go to Solution.
Hi
I have done this WF5
but have you added it in the table parameters(rep_rel_sortorder) as shown in the picture?
I assume that being able to sort by parameters which are not in the table is something which has been added in later versions?
This option of sorting by parameter not in the table is available since pro-e 2001 I believe
Regards
K.Mahanta
Hi
I have got a solution for you
But you need to add an additional parameter in your part parameters(Not in your drawing table)
If this is acceptable to you
Then I can give you the solution
Regards
K.Mahanta
I would prefer not to have to add another part parameter, but if that is the only way then I'd like to see your solution.
Hi
you can sort your table by any part parameter or system parameter whether that is in the table column or not
You can check the ppt
You need one such parameter which will allow the system to consider parts first and hardwares later
Foe example
You can have a parameter XXX having value 1 for parts and 2 for hardwares
If you have any such parameters then you dont need to add another one
In the example you will find that I have sorted by type
But you can sort by any part or system parameter
Regards
K.Mahanta
As I already have thousands of parts and assemblies modelled, I have tried assigining a value to my parameter sortorder using a relation in the repeat region table as follows:
if string_length(asm_mbr_name) == 13
sortorder = 1
endif
if string_length(asm_mbr_name) == 7
sortorder = 2
endif
But I cant find how to sort by this parameter as &asm.mbr.sortorder forward does not work.
Hi
(Your approch forced me to do more experiment with repeat region tables
I hope this will help you)
So Lets start
When you create a parameter in repeat region table relation;
it is not a part parameter.
So asm_mbr_sortorder will not work
You can test it by adding a column in your table and write &asm.mbr.sortorder
But it works in a different way
&rep.rel.sortorder
You can use this for your requirement
I tried this with a small assembly
You can try this for your assembly
Regards
K.Mahanta
Thankyou, for finding my error in trying to use asm.mbr instead of rpt.rel
In WF3 this works fine if the paramater is included in one of the table columns, but if it is not reported in the table then the sort order reverts back to what appears to be a default of asm.mbr.type then asm.mbr.name.
So I played about and found that I could include the parameter in a column of my BOM table but set the column width to -1 characters wide so that it is hidden. Not a smart thing to do if you ever want to edit that column though!
I assume that being able to sort by parameters which are not in the table is something which has been added in later versions?
I'm currently stuck using WF3 due to having IntraLINK 3.4 but will be moving up to Creo as soon as I can
Hi
I have done this WF5
but have you added it in the table parameters(rep_rel_sortorder) as shown in the picture?
I assume that being able to sort by parameters which are not in the table is something which has been added in later versions?
This option of sorting by parameter not in the table is available since pro-e 2001 I believe
Regards
K.Mahanta
Appologies, i didn't see the rpt_rel_sortorder in the parameters table, so now I have added that it all works fine.
Thanks very much for your help.
Hi
I am really happy to know that your problem is resolved
(I have also learned few new things)
Regards
K.Mahanta