I haven’t fully committed yet to coding all of my engineering calculators within the SketchUp API, but I am heading that direction as I further contemplate my next Sketchup Plugin: Medeek Structural Plugin.
The largest obstacle is the ability to generate MS Excel files and PDF documents (reports). For this to really work I need a way to have my plugin’s calculations export their data into nicely formatted spreadsheets and/or PDF reports. I have no idea where to even start and don’t even know if this sort of thing is remotely possible with SketchUp, the API or Ruby, I’m assuming it is because I am sure other people have run into this same sort of thing as me.
Any assistance or direction in this regard would be greatly appreciated.
Ultimately, I am hoping to create a structural plugin that will allow an engineer to do all of the lateral and vertical calcs for a typical residential or light commercial wood structure. The reason for using SketchUp for this sort of thing is the ability to leverage SketchUp’s intuitive drawing interface to create all of the building primitives/elements and provide an easy to use method for viewing and inputting building geometry and other design criteria.
I’ve actually had the idea to create this type of program since about 3 years ago but the show stopper was always the graphical interface and 3D component of it. Not until I began tinkering with the API about a year ago and waded into a full blown plugin development (truss plugin) did I realize the potential available within SketchUp. SketchUp and its API solves the 3D interface hurdle magnificently and now I am hopefully on course to create the one piece of software that will be the apex of my engineering career and hopefully further automate and advance the field of residential structural engineering.
I look forward to your efforts. Although I don’t (yet) use your truss or foundation plug-in’s, I truly enjoy your frequent posting of your progress.
One thought on the Structural Plugin - from my Tiny Home interest - One thing the Tiny Home Design community could use is center of mass calculation. This is a critically important for Tiny Homes on Wheels where maintaining a proper tongue weight (generally around 10% of total weight) means either compromising on the design of the home or moving the wheels of the trailer.
It seems to me that this should be an easy tangent to your basic structural calculations.
I would have to give this some more thought but at first glance the accuracy of any mass calculation will hinge on the level of realism and accuracy of the model. A THOW is composed of the trailer and the structure on top (the house). The trailer is probably composed of a mix of steel and wood components while the house is mostly composed of wood but may also have gypsum board, shingles, glass and other materials. To get an accurate determination of the mass and its distribution would require that each element or component is accurately modeled as a group/component “SOLID” with proper dimensions and that each solid is assigned an appropriate material type for weight calculations.
Since SketchUp automatically calculates a volume for a “solid” it is a no brainer to use the density of the material to calculate its weight.
As a proof of concept it may be educational to try and implement a weight and CG function in any of my other plugins to see how well something like this might work.
Speaking for myself in particular, and for at least a few other Tiny Home designers I’ve met who also use SU, we are already using solid (in the SU sense) components. I see no problem in requiring the addition of a keyword to each component’s name to indicate the material. The trailer itself might be a bit more difficult, as many are purchased as a unit. The weight is usually specified, but it’s an overall weight, no center of mass is specified.
Some things that go into the construction are hard to model - and hence hard to specify the necessary inputs for weight/CG calculation. Like building paper! It has mass, but it’s thickness approaches the minimum size that can be successfully modeled in SU, so most of us show building paper as a texture on the external walls, rather than as it is applied in real life.
there are Chrome extensions that allow reading.writing of xls type docs…
so, you could leverage one of those to use in a HtmlDialog where you can read and write using ruby…
they usually have a pdf export option as well…
OT: @TIG has a centre of gravity plugin at SCF…
I believe it takes the COG and mass of each ‘item’ and then finds the COG of the selection set…
there’s a lot of posts on the topic…
I’ve really only been working on the truss plugin for about a year now and there is a lot more to be done as well as two more plugins that I am hoping to get started on into the new year:
Medeek Structural Plugin
Medeek Wall Plugin
The structural plugin will deal less with the actual framing geometry and more specifically with the lateral and vertical engineering of the structure. It will be geared toward other structural engineers with the intent to automate residential structural engineering as much as possible.
Wood Shear Walls (segmented and perforated), Diaphragms (roof)
Beams, Headers, Joists, Rafters, Footings, Posts, I-Joists,
What will make this the killer app is that the 3D model will be able to automatically propagate the loads down through the structure while at the same time allowing the user to create the structure’s geometry in an intuitive and friendly 3D environment - SketchUp.
Of course the real power of such a plugin only becomes apparent when you create a model and then decide to build that same house or structure in a different location with different site criteria. Rather than having to start from scratch you simply enter in the new wind speed, ground snow load, and seismic design criteria into the model and the plugin recalculates the entire structure and then alerts you on any members that are undersized or over stressed. This would be particularly beneficial to homebuilders who have a set number of model homes they use but build in various locations.
You can generate output in CSV format. It’s super simple and can be opened in any spreadsheet program.
Good luck with the plugin .
I don’t know about PDF files. PNG files are easy, as are Excel (csv) files.
Check out the Ruby API docs on @model.active_view.write_image fname.
For excel files, check out the file i attached. The subject matter of the Ruby file is completely different - stock trading. But it shows an example of reading in an excel file (in the form of an CSV), manipulating it in Ruby, and writing out a results CSV file that can then be viewed/edited in Excel (or the Open Office equivalent that i prefer). Since this was just a quickie personal project, which i never expected to share with anyone, the code is not very formally written/commented. I apologize. But i think you should be able to find and copy the essential nuggets to do what you describe.
dividend_screen.rb (22.3 KB)
Good luck. And i am very interested in your Structural Plugin. I am working in steel and aluminum structures rather than wood frames. But i also have a need for structural analysis of those. To date i am relying on a cobbled together patch on a mostly developed component framework (Ruby class library) that allows me to format out my structures in native formats for external FEA tools (LISA, Frame3DD). Not very convenient or efficient (but it is cheap).
It’s not much to look at but this is the beginning of the Medeek Structural Plugin:
What is the status on this plugin?
I’m not trying to speak for @medeek, but based on his detailed updates in his Wall Plugin thread, I think it’s been set aside until the Wall Plugin is out of beta, at which time he might - and I emphasize might - continue working on a structural/load analysis package that uses as it’s input, foundations, walls, and trusses created the other Medeek extensions.
Initially I was going to build a stand alone structural plugin, but now I’m leaning more towards integrating this plugin with the other three plugins.
I have every intention on making this plugin a reality but it all hinges on how well the new Wall Plugin does with the SketchUp design community.
I’m estimating about 4-5 months of full time programming to really pull this one off, but there is no way for me to find the time to dedicate to this unless the other plugins “buy” it for me. So we will see what happens.
I really do believe though that if I were to couple a structural plugin with a fully mature design solution (the other three plugins, more mature than they are now) it would be a game changer in the industry. I’ve spent many hours running the numbers for residential designs and fully(or at least 95%) automating that process would be huge.
I applaud your efforts. I am a CAD drafter for a company that does live stock and horse panels, shelters and barns. We make these products out of round tube and changes are being made to how sites are permitted. At one time you could have a general set of engineered plans and the county where the product was to be installed would look them over and ok them. Now each building needs plans to the specific site and if changes are to be made it would be nice to have an idea of how these changes are impacting the building design. I think you are correct in your evaluation that this type of thing could be a game changer. Keep up the good work.