Create an entirely custom toolbar that loads ruby plugins?
-
Hi, Im trying to find out whether its possibvle to make a toolbar that has custom buttons with custom graphics that allow things such as importing as a mesh, loading an existing ruby plugin etc. Is this possible? How would i go about it?
Thanks
JP
-
Oh yes, this is definitely possible. What is your programming experience? There are many of us regulars around with all sorts of backgrounds. From those of us who have had no previous programming expernce, to others who are professional developers.
There is a thread at the top of this forum called "SketchUp-Ruby Resources", or here's a link to it:
http://forums.sketchucation.com/viewtopic.php?f=180&t=10142
Check that out, it has some great information in there. Specifically the SketchUp API is really the main thing you will need to invest some time to learning.
Then if you need more basic getting started help, there is lots of that around here too.
Chris
-
My tutorial, starting in Chapter 11 teaches the basics of Ruby programming with the SketchUp Ruby API. I don't cover toolbars, however.
Scarpino's book Automatic SketchUp covers toolbars briefly.
-
Hi, thanks for the reply, ive taken a look at that and im well on my way! along with using existing plugins ive managed to get a bit of my toolbar working ive never programmed ruby before but i have programmed in other languages.Thanks for the information.
I would also like to ask for help on another topic.
I have an exporter that when it has finished exporting tells me the poly count of a model.
see attatchmentI would like to alter this plugin to just show the polycount after all of its calculations and not export the model to a file. Could someone take a look at this plugin and tell me if its possible?
Thanks
JP
-
@jpjapers said:
I would like to alter this plugin to just show the polycount after all of its calculations and not export the model to a file.
PolygonMesh.count_polygons can output directly the count of polygons in each of the PolygonMesh objects created with the Face.mesh method.
You would make a copy of that script and rename it.
Create a tally variable, ie:
polytally=0
Comment out the part the writes the file.
Edit each part the creates a mesh, and use .count_polygons to add each poly subcount to the tally.
When the script is done making meshes for all the faces, you'd insert a
return polytally
line just before the end -
It would help if you posted the syntax error you get. It includes indication to where in the script you have errors.
And when you post code snippets, please wrap it [code] tags in order to preserve formatting and ease of reading.
-
Hi, looking through the script it seems it already has the polymesh.count_polys functionality.
I dont mean to be a pain but is there any chance you could take a look at the export script andshow me what i need to do to stop it from exporting and only output a message box with the poly count in it?I know its a big ask and if you cant its fine but it would be a huge help for me.Thanks again
JP
-
@thomthom said:
It would help if you posted the syntax error you get. It includes indication to where in the script you have errors.
And when you post code snippets, please wrap it [code] tags in order to preserve formatting and ease of reading.
Hey sorry i edited my post before i saw yours because i found a snippet that i didnt include and i thought it best just to ask someone who knows what theyre doing
Advertisement