The weight of a part is an attribute in the catalog in most circumstances, however, you can customize the calculation. You can customize the Weight and CG for a symbol by implementing ICustomWeightCG in the EvaluateWeightCG() method.
public class WBAParts : CustomSymbolDefinition , ICustomWeightCG
{
// Declare inputs
// Definitions of Aspects and their Outputs
// Implement ContructOutputs() to create the geometry and ports of symbol
// Implement EvaluateWeightCG() to set weight and CG on the symbol
public void EvaluateWeightCG(BusinessObject supportComponentBO)
{
try
{
double weight = 0, cogX, cogY, cogZ;
//Implement code to calculate weight and CG
SupportComponent supportComponent = (SupportComponent)supportComponentBO;
//Set weight CG on symbol by calling SetWeightandCOG()
supportComponent.SetWeightAndCOG(weight, cogX, cogY, cogZ);
}
catch
{ }
}