@unknownuser said:
This is exactly what I have been looking for I think. I just don't know how to program Ruby well enough, and I'm really unclear on the sketchup API object model. This rocks my whole world and maybe now I can finish that telescope.
I had such high hopes, but here there are a couple things that make it not work for me as is.
Here is a very simply example to illustrate the problem, and I am sure that woodworkers would be familiar. I corral parts into assemblies of sub parts and create components from them.
A side and a rail become a 'side assembly'.
Two side assemblies, a front, a back, and a bottom and a knob become a 'drawer'.
Three drawers become a 'drawer set'.
Two drawer sets, side by side go into a desk carcass.
Drilling down into a 'side assembly' and selecting the rail part I run CoG.
Then I select the side part and run its CoG.
Then I select both CoGs and run their composite CoG, to get CoG of the 'side assembly' system as a whole.
Because the side assembly is mirrored on the other side of the drawer, it too gets a composite CoG in it.
But the COG for it is physically on the other side of the drawer.
Going up a level in the assembly hierarchy is the 'drawer' component I'd like to get the CoG of it. It is the composite of the individual drawer parts.
the COG of the back
the COG of the front
the COG of the bottom
the COG of the knob
the COG of the left side (problem here)
the COG of the right side (problem here too)
The problem is, the left and right side assemblies don't have their CoG exposed at the same level as the other 4 parts.
If I use the outliner to drag the left one out of the one instance to the containing instance (the first drawer for example)then it has the correct position for the left side, but then its not part of the component anymore. Opening the right side assembly reveals that it is indeed gone. So before moving anything to the containing instance, I must first make a copy of it for each instance it exists in. Then, I visit each of those instances, select one of them in outliner and move it up a level. That works pretty good. Everything then being at the same level, (drawer) a composite COG for the drawer can be made. But again, once made, if you use more than one drawer (the 'drawer set') then you have to copy the CompCOG object for as many drawers as you have and visit each drawer with outliner and move those up a level in order to make a second level 'drawer set' CompCOG. And likewise for the desk carcass which consists of two of those 'drawer sets'. As you can see, its pretty darned cumbersome, but it works, and its potentially better than I had before with spreadsheets.
Of course, finding the CoG of a desk with drawers is trivial because who cares. It's on four legs and it sits stationary in an office. But a telescope is required to be balanced. There are mirror cells, draw tubes, eyepieces, bearings, gimbals, finder rings, finders, prisms, dew heaters, tracking motors, cameras and every imaginable part.
A warning when you pull something in from a saved component that has one of these CoG elements in it. Sometimes the embedded "CoG" crosshairs get renamed to "CoG#1" and "CoG#2" etc. The code, as it stands ignores them. To make them work, you need to replace them with "CoG" after you reload the saved component... which negates the whole reason for saving components in my estimation... I haven't gotten the hang of all that, especially when it comes to replacing complex components for simplified proxy components to speed up rendering.
The thing is, I really like Sketchup. It's intuitive, accurate enough for actually building things. I understand how it works out of the box. And every time I go back to TurboCad I feel like I want to take a shower. The learning curve on Autocad and SolidWorks (as if I could ever afford that) is so far beyond my capability If it were my job it would be a different story, but I'm not an architect or mechanical engineer.
When I have $400 - $4000 to kill, I spend it on tools for my woodshop. I think a lot of other Sketchup users are the same way. Spending $10-#20 on a great script is not a problem though. I drop that kind of dough in a heartbeat down at the home improvement store every week.
So TIG, if you can figure out my ramblings (sorry, I am like that) I would be willing to donate $20 or more and I would urge others to contribute to make it worth your while too.