demoEnumerateParameters.py

demoEnumerateParameters.py
1 '''
2  Creates all geometric objects and lists their parameters.
3 '''
4 import MaxPlus
5 import sys
6 
7 for cd in MaxPlus.PluginManager.GetClassList().Classes:
8  if cd.SuperClassId == MaxPlus.SuperClassIds.GeomObject:
9  print 'Create class ', cd.Name
10  o = MaxPlus.Factory.CreateGeomObject(cd.ClassId)
11  i = 0
12  for p in o.ParameterBlock:
13  type_name = MaxPlus.FPTypeGetName(p.Type)
14  try:
15  print ' parameter', i, p.Name, p.Type, type_name, p.Value
16  i += 1
17  except:
18  etype, evalue = sys.exc_info()[:2]
19  print 'error ', etype, evalue