Skip to main content
1-Visitor
August 3, 2022
Question

Roll-up child part weight onto parent part in PartStructure

  • August 3, 2022
  • 3 replies
  • 2861 views

Hi all,

I'm trying to achieve to display the addition of weights of the child part onto the parent Part in the structure.

Attached is the image of the same.

Referred to CS228951 however that's not working may be I'm making some error.

Any suggestions or references?

Thanks in advance

Regards.

 

 

3 replies

14-Alexandrite
August 3, 2022

Is Weight attribute on WTPart? can you paste your mapping?

Durga1-VisitorAuthor
1-Visitor
August 3, 2022

Yes its First on EPM from SolidWorks CAD then passed to related WTPart.

Created an alias attribute on subassembly WTPart with following mappings,

Mass is the internal name of attribute on EPM and related WTPart

Tried both given below 

masterReference^wt.part.WTPartMaster~uses@wt.part.WTPartUsageLink~usedBy^wt.part.WTPart~masterReference^wt.part.WTPartMaster~uses@wt.part.WTPartUsageLink~usedBy^com.xxx.sl_wct.RawFinish~Mass

masterReference^wt.part.WTPartMaster~uses@wt.part.WTPartUsageLink~usedBy^com.xxx.sl_wct.RawFinish~Mass

23-Emerald III
August 3, 2022

We use this relation in part and assembly start files:

/*** SET WEIGHT PARAMETER ***
WEIGHT=PRO_MP_MASS

 

If you have material assigned, the parts will get the weight. You do have this.

In the assembly, it will sum all of the weights of the component parts. This is what you are asking for.

Durga1-VisitorAuthor
1-Visitor
August 3, 2022

Any references to execute it.

23-Emerald III
August 3, 2022

No, just add that line to your relations in each part and recalculate the mass, then do a regen to update the Weight parameter. We do it with a mapkey.

17-Peridot
August 4, 2022

@Durga -if you have the attributes on the WTParts you can use this pattern to show rollups in PSB.  It will rollup the values to display in the Structure view (there is not a persistence mechanism - it is always dynamically shown in the structure)

 

Please note when showing this it does add the calculation overhead so one might want to have a table view specific for rollups.  These samples are available from Windchill 11.1 onwards.

 

Sample Code (from Help)