In addition to custom functions, you can also create custom compound values in MAXScript using "structure definitions". Structure definitions are a flexible data type, built of simpler data types. They let you define the layout of a new structured type of value that you can then create and work with in your code.
The syntax for a structure definition is:
where each <member> can be one of:
Create a new structure, called person:
Now create an instance of this structure using the ‘person’ constructor:
This stores an instance of the person structure in the variable Bill. Member name is initialized to the string value "Bill", height to the integer value 72, age to the integer value 34, and sex to the name value #male. Create another instance:
In this example, another ‘person’ is created. However, this person does not have initialized values for the height and age members. Since you did not provide these members with an optional default value in our structure definition, they will default to a value of undefined.
Structure definitions are a good alternative to arrays when you have a fixed, small number of components. The code for these types of values is easier to work with since you can reference property names rather than index numbers in arrays.