Does anyone know of a method to have SolidWorks automatically spit out a component's centre of gravity location in reference to its assembly's origin, e.g. in a Bill of Materials?
This cannot be done automatically, but there is a macro out there that will add a 3D sketch with a point at the center of gravity. You can then dimension to this point on a drawing.
The only thing you need to be careful of is to recognize that it does not automatically update. You need to re-run the macro every time the center of gravity changes.
As I recall, Wayne Tiffany has several CoG macros on the Kansas City SolidWorks Users Group website. It's possible that one of them updates automatically.
Here is a link to a thread that Wayne Tiffany spoke to COG's in.
Thanks guys for the responses. However, it didn't solve my problem.
Here's an assembly to explain the problem better.
I'm after the coordinates of the cylinder's and box's CoG in relation to the boat's origin.
This is one of the uses for the coordinate system tool: Insert>Reference Geometry>Coordinate System.
Add a coordinate system at the boat's reference.
Then you can go to the mass properties, and there is a dropbox called "Output coordinate system". Change that to the one you create for the boat reference. Then "recalculate" and you should be able to find the COG relative to any coordinate system you specify.
Thanks Charles, this works if you edit the component and create the coordinate system and THEN run the mass property on that component. The drop-down list shows only coordinate systems that belongs to the model you are calculating, i.e I can not choose the assembly's origin (unless it is copied in the component) when I am running the mass property of one its components. So it is possible although it requires a lot of manual work, especially if you have large assemblies.
I've been working on something that might work for you too.
It's not what I would call Automatic, maybe Semi-Automatic.
It creates a macro feature that uses the rebuild (Ctrl-Q) to reset the coordinates the CofG.
Does your machine have Excel on it? If so - which version?
What I have so far seems to work with your model on my machine.
Feel like being a beta tester? :-)
I've got Excel 2007 on the machine.
I'll be the guinea pig, no worries, mate.
I've been reading your posts.
I'm not sure what I have will do exactly what you are looking for.
I'll have to send what I have to you tomorrow.
Attached is a zip file that contains my not quite finished CofG.swp and the other files required.
Please read the CofG.txt for inportant set up information.
I was wondering if you were able to make the macro work?
If so - was it something like what you were looking for?
Sorry about the delayed reply, but thanks a lot for your reply.
Unfortunately, it doesn't solve my problem.
I'll try to explain the problem again:
Let's say I have 2 components, 2 cubes with identical dimensions and weights.
They are placed in an assembly, so the coordinates of the CoG of that assembly are x=2, y=0, z=0.
That means that the cubes' respective CoGs are (could be) located at x=3, y=1, z=0, and x=1, y= -1, z=0. This is in relation to the assembly's origin.
It is those 2 latter xyz-coordinates I'd like to have published.
It is only possible to get the total assembly's (2,0,0) coordinates or the individual component's coordinates in relation to that component's origin, which is, if the cube was created symmetrically round the origin it is 0,0,0.
Or maybe you have got the answer behind the "Add Target" button in your macro. I couldn't figure out its intent.
I think I understand now. You are working at two levels. One level we could call "cubes" and the other level is the next assembly we could call "final assembly".
The macro I sent you will work to produce the CofG w/dimensions feature at the "cubes" level. At this level as you change the cubes the CofG will semi-automatically update.
At the next assembly level "final assembly" you need to create driven dimensions from the macro created CofG in "cubes" to the origin of the "final assembly".
Since we can use the macro to produce the dimensions at the "cubes" level, you would like to automate (make macro) to produce the dimensions at the "final assembly" level.
Am I understanding this correctly?
The "Add Target" button in the macro will not help you. It's just to automate inserting a "Target" part that will show up better than a point in a drawing.
When you say "I'd like to have published" - what form do you mean published? Dimensions or a Table or maybe Excel?
Hope this helps
Yes you got it right, Tobin.
If you look at the attached file, on the top of the drawing, published in the BOM, you will see the 6 values I am after. I have just manually entered these values, I'd like to have that automated.
And published in a BOM or in a spreadsheet.
Retrieving data ...