Macro to Fix Assigned Mass Properties this will let you check for components with a mass override.
As for the mass & cog coordinates you can add any custom property and use the following value:
This is a generic formula and will evaluate automatically for every component.
Thank you for your suggestion, but for unsymmetrical objects the center of gravity coordinates are different from that of center of mass.
So is there way to get the values of COG coordinates
The difference between center of gravity and center of mass has nothing to do with symmetry.
Center of mass and center of gravity are the same on a rigid part in which the gravitational field around that part does not change.
The only time Center of mass and center of gravity are different is when the gravitational field is fluctuating or changes.
"A body's center of gravity is the point around which the resultant torque due to gravity forces vanishes. Where a gravity field can be considered to be uniform, the mass-center and the center-of-gravity will be the same. However, for satellites in orbit around a planet, in the absence of other torques being applied to a satellite, the slight variation (gradient) in gravitational field between closer-to (stronger) and further-from (weaker) the planet can lead to a torque that will tend to align the satellite such that its long axis is vertical. In such a case, it is important to make the distinction between the center-of-gravity and the mass-center. Any horizontal offset between the two will result in an applied torque.
It is useful to note that the mass-center is a fixed property for a given rigid body (e.g. with no slosh or articulation), whereas the center-of-gravity may, in addition, depend upon its orientation in a non-uniform gravitational field. In the latter case, the center-of-gravity will always be located somewhat closer to the main attractive body as compared to the mass-center, and thus will change its position in the body of interest as its orientation is changed.
In the study of the dynamics of aircraft, vehicles and vessels, forces and moments need to be resolved relative to the mass center. That is true independent of whether gravity itself is a consideration. Referring to the mass-center as the center-of-gravity is something of a colloquialism, but it is in common usage and when gravity gradient effects are negligible, center-of-gravity and mass-center are the same and are used interchangeably."
Edit: Therefore, if you are working on a rigid object that will not have fluctuations in the gravitational field around it, then you can assume that the center of mass and the center of gravity will be the same.
Not sure what you mean. The SW-CenterofMass refers to the coordinates of the Center of Gravity. Always. whether its the modeled or overridden coordinates. SW-COG is a way to override the coordinates in a design table. SW-Mass is the syntax for the override mass value.
The code below will tell you what mass properties are overridden and give you the values in default units.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swMassProp As SldWorks.MassProperty
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swMassProp = swModel.Extension.CreateMassProperty
If swMassProp.OverrideCenterOfMass Then
MsgBox "CenterOfMass Properties are overridden!!"
MsgBox "CenterOfMass Properties are not overridden!!"
If swMassProp.OverrideMass Then
MsgBox "Mass Properties are overridden!!"
MsgBox "Mass Properties are not overridden!!"
Debug.Print Round(swMassProp.CenterOfMass(0), 6), Round(swMassProp.CenterOfMass(1), 6), Round(swMassProp.CenterOfMass(2), 6)
Stop 'SUPPRESS FEATURE HERE BEFORE CONTINUING
Correction Elmar, it refers to the center of mass.....technically this is different than the center of gravity.
I think we are splitting hairs here.
_________If you are interested - Read below for my take on the difference between talking and explaining______
Since you are making a point, why not go all the way and explain the fine details. I very much enjoy meaningful dialog.
Empty phrases on the other hand are a waste of time. Technically speaking there is a difference between know-how-it-works and know-how-to-talk.
Well, it all depends on what his application is.
If he is designing satellites, then center of gravity is a really important thing, in relation to how it is different than center of mass.
But its a moot point, I guess:
I guess the answer that I should have given, is this:
No, until you add the influence of a gravitational fields (which you MIGHT be able to in Solidworks simulation, but I am not sure), then Solidworks will NOT be able give you the center of gravity, if it is different than the center of mass. Until then, Elmar's answer is correct.
In most cases, the center of mass and the center of gravity are the same.
You are correct, I was splitting hairs. I apologize.