Dia can be run from the command line. This allows certain Dia capabilities to be used in batch script files. See Dia Command Line for more information on creating your own custom shapes.