One possibility is to wrap the code that specifies topology and geometry in
a proc and embed it in the template, then call that proc from your template's
init proc. But that involves many tedious details that are easily overlooked.
Far easier is to take advantage of the GUI tools, which can generate a lot
of hoc code for you.
Presumably you want to make a network model (why else bother with cell
classes?). The steps are:
1. Get the morphometric data into a CellBuilder. If the original data are in
Neurolucida, Eutectics, or swc format, use the Import3D tool. If instead
you have a hoc file full of pt3dadd statements, start NEURON, xopen the
hoc file, then start a new CellBuilder and use its Management page's
Import feature. When the CellBuilder contains the morphometric data, save
it to a ses file and exit NEURON. (after this point it is assumed that you
will periodically save things to ses files).
2. Restart NEURON, load the CellBuilder's ses file, then specify the
biophysical properties and spatial grid. Test the model cell to verify that
it has the desired properties.
3. Import that CellBuilder into a Network Cell tool, and use the latter to
specify the locations of synapses.
4. Use the Network Builder to create a prototype network that involves an
instance of your cell class, then export that network model to a hoc file.
5. That hoc file will contain a template for each cell class in the toy network,
plus code that sets up the connections between them that you specified.
You can extract those templates and use them in your own networks.
For tutorials on the CellBuilder, Import3D tool, and Network Builder, see the
Documentation page http://www.neuron.yale.edu/neuron/docs
For an example of mining reusable code from a hoc file exported by the
Network Builder, see chapter 11 of The NEURON Book.