I want to add a point on center of mass of a part .
is there any option to do it?
A simple thing you can do is
go to 3d sketch and insert a point click anywhere in document window then go to the property of 3d point and simply enter the values of center of mass displayed in mass properties.
Hope this helps
TON of Thanks Ajay for your quick response.
Or run the attached macro, which should place a sketch point in a part / assembly.
This sketch point will also show up in the drawing of the part / assembly.
Mark (SolidWorks 2011 SP2)
The macro needs to be re-run each time the model is modified in order to update the center of mass location.
Follow me on Twitter
Here's a parametric way of doing it. Create a 3d sketch with a point in whose location is driven by the center of mass custom properties (X, Y, Z). The downside is that you can get yourself into a circular dependency quite easily if you use that sketch point to drive another feature.
Can you post a 2010 version of the file or please explain how to link the values parametrically.
I tried using an equation but it wouldn't allow me because the x CofG co-ordinate was negative.
And that's one reason why we need equations to accept negative numbers.
Sorry - yes, I did forget to mention that my solution doesn't work for negative or zero values.
@Matt: you meant dimensions need to accept negative values, right ?
Dimensions accept neg numbers. We need equations to do so as well.
Dimensions do, but they quickly become positive once the direction has changed. Wouldn't you need them to stay negative in some cases?
Yeah, that is a great idea too that might make it easier for SolidWorks to allow equations that have neg values.
Attached are 2 versions of a macro that when run will place a CoG point on your part / assembly.
This point will also be shown in a drawing.
If I remember correctly one needs to be updated, the other automatically updates when the model changes.
Of course the easy way would be to have this capabilities available inbuilt into the SolidWorks program (as Inventor has).
This has been requested for a number of years now, and I am still waiting.
When I run either one I get the following message. See Attachment.
The macros do put the point in the assy at CoG though. Should I have
SW API installed. Am not very educated in programming.
Check that in your Tools -- System Options -- File Location -- Macros.
The path is the same as where you have save the macro.
Retrieving data ...