  | | | Python introspection... | Python introspection... 2005-04-05 - By Jerry Gamache
Back Ever wondered what function an XSI object exposes at runtime?
def GetFunctions( dynDisp ): """returns a sorted and unique list of all functions defined in a dynamic dispatch""" dict = {} try: for iTI in xrange(0,dynDisp._oleobj_.GetTypeInfoCount()): typeInfo = dynDisp._oleobj_.GetTypeInfo(iTI) typeAttr = typeInfo.GetTypeAttr() for iFun in xrange(0,typeAttr.cFuncs): funDesc = typeInfo.GetFuncDesc(iFun) name = typeInfo.GetNames(funDesc.memid)[0] dict[name] = 1 except: pass # Object is not the dynamic dispatch I knew ret = dict.keys() ret.sort() return ret
import pprint
funcs = GetFunctions(Application) Application.LogMessage(pprint.pformat(funcs))
funcs = GetFunctions(Application.ActiveSceneRoot) Application.LogMessage(pprint.pformat(funcs))
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|
 |