Creating a manifold block: A simplified case study.

Suppose as a designer your firm has a client that needs many different types of the same model, thankfully this time their project is extremely simple a block with a hole or holes in it. The trouble is the design team can't seem to make up their mind about any of the particulars of the design so you must be prepared to constantly rebuild the model.

Scripting is great in a case like this instead of rebuilding the model every time and saving it to a new file you can manage its' design from scripts. The script also shows you exactly where the drilled holes are in the block and the size of your block at a glance so it functions as a lowly form of command history and a parametric modeler. You can also include a date in each file to track changes you made to the script. Imagine then that you had to generate many changes to the block size and drilled hole location you now have a way to solve that problem along with a way to easily track changes.

Analyzing the modeling process before you begin writing the script.

Above is a sketch illustrating the block manifold.

This fills the first requirement of making a command script that builds a model, that of gathering the information. In Rhino it is an easy matter to build the block. The first inclination would be to use the box tool for the block shape then create a cylinder the size of the cutout and Boolean subtract that from the block to create the cutout. Because Boolean operations cannot be used in Rhino scripts you can't use the previous example.

There is an easy alternative and one that doesn't use the Boolean subtract operation at all, so you actually save a modeling step. That is using the extrude command instead. The extrude command in Rhino is fantastic because it can recognize line shapes placed within larger shapes as holes. In this case a circle placed within a rectangle then extruded becomes a block with a hole in it. These are easily scriptable procedures. See image below

Taking out a piece of paper you write down the basic steps it took you in Rhinoceros using the extrude method to create the block manifold.
1. Rectangle
2. Circle
3. Placed circle
4. Selected curves
5. Extruded the curves

You have now filled the second requirement. You have found a scriptable procedure to create your model.