The chemobj command

This is an utility command to help with the generalization of commands applied to the various explicitly named chemistry objects in the toolkit.

The following subcommands are supported:

chemobj class

chemobj class objecthandle

Returns the class or Tcl command name associated with the major object identified by the handle. This command may also be invoked as chemobj tclcommand.

chemobj eval

chemobj eval subcommandname objecthandle ?args?...

Execute the Tcl command associated with the object. The subcommand name, object handle and optional arguments are all passed to that object-specific command in that order.

This command is intended to make it easier to exploit the regular structure of the chemistry Tcl commands, providing an easy method to invoke the same functionality on different kinds of major objects without the need to inspect the handles or perform other checks to identify the object type. This command invokes the original class command. It does not perform error checking on its own. It is only safe to be used with subcommands which use identical syntax, or at least an identical syntax with a specific argument set, for all object classes a script is expected to encounter.

Example:

chemobj eval purge $handle $proplist

Above command purges the properties in the list from the passed object, regardless whether the object is, for example, an ensemble, a reaction, a dataset or a table.

chemobj get

chemobj get class/handle attribute

Query information on a chemistry object class. The identifier may either be a class name, as returned by chemobj list , or, for major objects, a valid object handle. The following attributes are recognized:

chemobj list

chemobj list ?pattern?

List the currently loaded chemistry object classes with their primary name.

chemobj pythoncommand

chemobj pythoncommand objecthandle

Returns the Python class associated with the major object identified by the handle. This command may also be invoked as chemobj pythonclass .

chemobj tclcommand

chemobj tclcommand objecthandle

Returns the class or Tcl command name associated with the major object identified by the handle. This command may also be invoked as chemobj class.