Here is a small little tip on how to include the center of gravity (COG) on your drawings.
I must admit that I narrowed the scope down a bit by looking only for the COG of sub-assemblies and not individual components.
With a bit of work, the procedure as explained below can be modified to suit also the display of COG of individual components.
My first thought was to use a parts list to display the COG.
But in situations where there are multiple instances of the same sub assembly (take an assembly pattern as example), each instance will have a different COG.
And as we all know, the parts list will roll-up all instances into a single row, which makes it useless to display COG on an instance-per-instance basis.
A better vehicle to display the COG is a generic table. Here is the workflow that I followed.
- Open up any assembly that contains sub-assemblies
- Run the macro that you can find here.
The macro generates a CSV file in the workspace.
The file has the same name as your assembly but with the extension .csv - Create a drawing view
- Add a generic table to the drawing based on the CSV file
- Run the macro again when your assembly has changed.
The generic table will update automatically once you activate the drawing.
Fig 1: a generic table with center of gravity data
The table in Fig 1 shows the result that I obtained on a not so randomly picked assembly J.
Note that the last two sub-assemblies have the same geometry but are obviously in a different position.
Enjoy!
Bob



Subscribe
Thanks Bob,
This will help me no end. I would just like to ask if this could be modified so the table would only show the top level sub-assemblies COG within the main assembly.
For example, within my main assembly, I may have a Platform arrangement constructed of multiple sub-assemblies. The COG of these sub-assemblies is lesser importance than the overall COG of the Platform. Therefore It would be benefical if I could eliminate these from the table.
Thanks once again,
Posted by: Graeme Cooper | 11/17/2011 at 12:09 AM
Thanks Graeme! Always pleasant to hear that you can put myposts to good use.
In the first sub there is following call near the end of the sub:
Call processAllSubOcc(oCompOcc,sMsg,iLeafNodes,iSubAssemblies)
Just comment out that line by placing a single quote in front, like this:
'Call processAllSubOcc(oCompOcc,sMsg,iLeafNodes,iSubAssemblies)
As a result you will get the COG of only the first level subassemblies. Hope that was what you were looking for.
Bob
Posted by: Bob Van der Donck | 11/17/2011 at 05:12 PM
Yes Bob, that's exactly what I was looking for.
Thanks again.
Posted by: Graeme Cooper | 11/17/2011 at 11:36 PM
Hi there,
Just wondering has a hot fix been created for the issue of manually converting constraints to joints in Inventor Simulation where I get the error that both parts are the same?
Cheers,
N
Posted by: Niall Smyth | 11/26/2011 at 01:33 PM
Sorry posted comment above under the wrong thread!
Posted by: Niall Smyth | 11/26/2011 at 01:37 PM
Hi Bob, if you're still checking this posting I was wondering if you could tell me how I can add the volume of the part to the macro you wrote. I need the part volume along with the centre of gravity to perform a buoyancy calculation of my assembly.
Many thanks,
Lachlan
Posted by: Lachlan | 01/09/2012 at 06:28 PM
Bob, I forgot to say that I needed the macro to asses every individual part in my assembly. Does this mean I need to add a line of code to delve deeper than the sub assembly level you aimed at?
Thanks,
Lachlan
Posted by: Lachlan | 01/09/2012 at 09:04 PM
Lachlan,
I added another macro that you can download here:
http://beinginventive.typepad.com/files/COG_in_drawing_tables/scan_COG_VOL_assembly.txt
It adds both COG and Volume information to the CSV file and works now also on individual components, not only on subassemblies. I make no attempt in showing the assembly hierarchy in the CSV though.
Bob
Posted by: Bob Van der Donck | 01/11/2012 at 04:07 PM
Hi Bob,
Thank you very much for accommodating my request. Unfortunately I can't seem to run the macro in my assembly. I get the following error:
Run-time error '52':
Bad file name or number
When i select the debug button it highlights the "open outputfile for output as #1".
Do I need to be smarter than copying this into a macro within the file and trying to run it?
Lachlan
Posted by: Lachlan | 01/11/2012 at 09:31 PM
Make sure to close down Excel or at least close any previous versions of the csv file you have open in Excel. If you run the macro multiple times on the same assembly, the macro will attempt to create a csv file with the same name over and over again. This can only happen if there is no previous version of the file is open in Excel. That is my guess on what is going on.
Bob
Posted by: Bob Van der Donck | 01/12/2012 at 08:00 AM