How to use EnumType Object

By Xiaodong Liang

By EnumType object, you could get all possible values of the various enumerations in Inventor API, like the UnitsTypeEnum, ObjectTypeEnum and so on. This object is accessed by

Application.TestManager while TestManager is a hidden object currently. This means you could use it but we do not support it. The code below dumps all values of ObjectTyp​eEnum.

Sub GetEnumType()

  Dim oEnumType As EnumType
  Set oEnumType = ThisApplication.TestManager.GetEnumType("ObjectTyp​eEnum")
  Dim index As Integer
  index = 0
  Do While index < oEnumType.Count
    Debug.Print oEnumType.ValueName
    Debug.Print oEnumType.Value

    oEnumType.MoveNext

    index = index + 1
  Loop

End Sub


Comments

One response to “How to use EnumType Object”

  1. TestManager is hidden object?

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading