UDT Datatype generation through scripting

Is it possible to create UDT Datatypes in scripting? I know it is possible to create UDT instances, but I would like to create the UDT Datatype itself.

Thank you