RhinoCommon Creating a Curve Section Library


I would appreciate an advice on approaching a fairly common task. Namely, imagine having a structure with connected linear elements. And you would like to generate 3d beams (steel elements) with different cross sections parametrically - all from code. And, in time, you want to grow your “library” of those cross-section profiles. Now, what would be the most sensible way of approaching this?

The puristic approach would be to save every profile as a function - a set of instructions that generates the profile curves from scratch. That is “pure”, no external file needed, everything saved as text/code, but that is computationally expensive.

So, is there a way to save these cross section curves in separate (3dm) files and somehow access them from code? Open the file and extract the curves in the background, silently? (Although this sound as computationally expensive as well)

Or is there another way of saving curves and accessing them?


Why would this be computationally expensive?

Personally I would go this route; It will allow you to develop parametric cross-sections. For example you could define a function (or a class) to generate an I-beam/column that accepts inputs for height, width, flange depth, fillet radius, etc.

An approach that would be very cool, but for sure slightly more computationally expensive would be to develop these functions as grasshopper definitions (see this simple example and Revit’s “Grasshopper Player” for ideas!).

I think I would try to find either:

  • A plugin which already does this (Visual ARQ?) or
  • A section table in csv or similar format with all the geometric data (you can save Excel to csv)

I would then write a script to select a section from the table and build it on demand