How can I find if Mass Properties have been Overridden
How can I find if Mass Properties have been Overridden
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?
-
- Posts: 82
- Joined: Thu Jan 20, 2022 3:35 pm
- x 31
- x 91
Re: How can I find if Mass Properties have been Overridden
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>
```
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
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.
End SubDim 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
Deepak Gupta
SOLIDWORKS Consultant/Blogger
SOLIDWORKS Consultant/Blogger