When I ask for the center of gravity of a set, it displays well and I can see with the mass properties the XYZ coordinates.
As assembly is a complicated kinematic, I would like the coordinates to be displayed permanently. Today I created a sketch that gives me these coordinates, the only problem is that I can't see it all the time. a) you have to rebuild so that the new coordinates are displayed, then open the sketch to have the numbers (or property of the CM)
With the inventor of 12 years ago (long before the CM existed in SW) the dimensions appeared dynamically on the screen (like a scrolling counter).
I couldn't find anything in the online or on the net help for SW.
The attached macro offers the display of the coordinates of the CdG of an assembly automatically, after a movement of one or more components, in response to an event of type " swAssemblyComponentMoveNotify2 " (phew...) sent by SolidWorks.
Before determining the position of the CdG, SolidWorks must necessarily rebuild the assembly to update its geometry. Given this delay, the display of the modified coordinates cannot be done continuously as the movement progresses, it is only possible when the movement is complete.
For the same reason, the possibility of taking into account other events (change of a dimension, a constraint, etc.) has been excluded, due to successive and rapidly unbearable downtimes. The " Calculate " button on the right side of the window offers the user the means to recalculate the CoG at any time of their choice.
I look and keep you informed of the result. Even if I have to click calculate, this will go faster than Ctrl B "rebuild" + Ctrl M (mass properties display) + Esc to get back on the screen.
There is no change of side, only a rotation with parts that move during the rotation and therefore change the position of the CM
The macro record doesn't matter... The most practical is a personal folder in which to store macros to find them easily.
In use, the important thing is to be able to activate it from SolidWorks by associating it with a button placed in the macro toolbar (or any other toolbar). Customizable button for immediate recognition (see video).