Different molecule builder tools have different ways of assigning angle, dihedral, and improper parameters according to atom type.
If you are using moltemplate, then the procedure is demonstrated graphically on slides 51-54 of this PowerPoint presentation:
http://moltemplate.org/doc/moltemplate_talk_2013-8-07.pdf
…and explained in detail in chapter 6.2 the moltemplate manual:
http://moltemplate.org/doc/moltemplate_manual.pdf
The way you do this in topotools is explained here:
https://sites.google.com/site/akohlmey/software/topotools/topotools-tutorial—part-2
and here:
http://www.ks.uiuc.edu/Research/vmd/plugins/topotools/#TOC-angle-dihedral-improper-typenames
I’d add that doing this manually is somewhat unusual. When simulating a reasonably complex system it would be tedious to write these rules yourself (for every possible quarter of atom types in your molecules).
People frequently use force fields like OPLSAA, CHARMM, AMBER(GAFF,GAFF2), GROMOS, COMPASS, PCFF, CVFF, …
Moltemplate currently includes a database of all of the OPLS, GAFF, GAFF2, and COMPASS force field parameters (and angle, dihedral, improper generation rules, and in some cases, rules for generating partial charges.) These rules are written using the same syntax I mentioned above. Simple examples of force fields in moltemplate format are located here:
http://moltemplate.org/examples/force_fields/
The EMC molecule builder includes the
Born, COMPASS, PCFF, CHARMM, OPLS, CVFF force fields.
In both programs some of the COMPASS, PCFF, CVFF parameters have to be omitted due to potential copyright issues.)
I hope this helps.
Andrew
(Disclaimer: I wrote moltemplate, so I tend to explain how to use it in more detail.)