Page 1 of 1
How can I find if Mass Properties have been Overridden
Posted: Fri Aug 18, 2023 8:00 pm
by loeb
I have some assemblies and discovered that someone, a long time ago, overrode the mass properties of some of the parts. Other than going through every part and checking if the mass props have been overridden in every configuration, is there an easy way to identify them?
Re: How can I find if Mass Properties have been Overridden
Posted: Sat Aug 19, 2023 1:37 am
by ryan-feeley
I'm sure there's an API solution that loops through all your models... But short of that, if you only care about parts that are used in assemblies, if you look at the "Mass Properties" of each top-level assembly, there is a note at the bottom that indicates if any part within the assembly hierarchy is overridden.
Here is the relevant section from the
Swx on-line help:
I looked at one of my assemblies, which I know has some aspects overridden, and I see this at the bottom of that dialog box. Of course, as you pointed out, mass properties can be overridden on a per-configuration basis, so just looking at the assemblies is very incomplete. But it may be enough to catch anything important.
```
One or more components have overridden mass properties:
10130 - PCB Assy@10128 - Loaded PCB Assy@10123 - Pivoting Elements Assy
10228 - Bare Cable<Default>@10121 - Cable Assy, 8cond, 1.25mm PicoBlade, Custom Anchor<Default>
```
Re: How can I find if Mass Properties have been Overridden
Posted: Sat Aug 19, 2023 4:46 am
by gupta9665
For single file (active config), you can use following codes. The codes can be further modified to traverse each component's configurations and create a report with the components name and their configurations in which mass is overridden.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim MassProp As SldWorks.MassProperty
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set MassProp = swModel.Extension.CreateMassProperty
If MassProp.OverrideMass Then
MsgBox "Mass Properties are overridden!!"
End If
End Sub