PcoWSkbVqDnWTu_dm2ix

2 min

An enumeration — sometimes shortened to “enum” — is a special data type that can take one of a set of values. For example, the enum/Material enum represents the material type for a part.

In a script, enums are accessed through a global object called datatype/Enum. To get all of the datatype/EnumItem|EnumItem options available for an enum, call the GetEnumItems() method on an enum type:

Once you know the datatype/EnumItem|EnumItem options, you can set an enumerated property on an object in three different ways:

Tags:
  • lua
  • enumeration
  • enum