Method to Create UDT Definition

Is there a method to create UDT definitions in code? If so does anyone have and example?