Showing results for 
Search instead for 
Do you mean 
Reply

Retrieving calculated assembly weight

Hello everyone!

Is it possible to retrieve and put in an attribute calculated assembly weight from the ANT (or part weight for that matter) WITHOUT the Advanced assemblies license?
5 REPLIES

Re: Retrieving calculated assembly weight

[ Edited ]

According to the API reference guide, the UF_WEIGHT_ask_props function requires only a gateway license. This function will not calculate the weight, but only returned the cached value of the part, component, or solid body passed to it. If you pass in a part, the value will represent only that part, it will not include the components (if there are any). So it looks like you could ask the value of an individual part or component without having an advanced assemblies license.

 

The functions UF_WEIGHT_estab_part_props and UF_WEIGHT_estab_comp_props will calculate the weights and will include component weights if desired. According to the API reference, these functions also only require a gateway license. However, these functions require a special "exceptions" structure as one of the inputs; there is a separate function to initialize this structure (UF_WEIGHT_init_exceptions) which does require the adv_assemblies license to use.

 

So it would appear that you can retrieve the saved value for an individual part, component, or body without a special license; but to calculate/retrieve the weight of an assembly would require a license.

Re: Retrieving calculated assembly weight

"So it would appear that you can retrieve the saved value for an individual part, component, or body without a special license; but to calculate/retrieve the weight of an assembly would require a license."

As far as I can understant it, this gives the opportunity to calculate assembly weight programmatically by adding weights of individual components then.

Re: Retrieving calculated assembly weight

"As far as I can understand it, this gives the opportunity to calculate assembly weight programmatically by adding weights of individual components then."

 

Assuming all the weights have already been calculated and the values are up to date, it should work. However, you will need to be careful with promoted and deformed bodies.

 

If you are looking for assembly weight data, I'd suggest collecting all the occurrence bodies and using the AskMassProps3d method. In this way, the weight would be calculated in one call rather than summing the weights of individual bodies, the weight would be up to date, and it would not require special handling of promoted and deformed bodies (if you are assigning weight values to individual component attributes, these may still require special handling).

Re: Retrieving calculated assembly weight

Yeah, part altered at the assembly level are a special kind of headache. Man Happy

Re: Retrieving calculated assembly weight

I did some quick tests with assembly containing two components and promoted and partially cut bodies. Asking for mass info at the top level returns negative number, actually a difference between combined mass of components and a resulting mass of an assembly. It is possible to do a subtraction and receive correct result. At a glance, it should work. As far as I know, this is exactly a system that is in place with Teamcenter.