OK, previous post indicated I had something, but I'm not doing something right b/c I get the same nodes printing no matter what I select.
So apparently this does not in fact work:
mgWalk (rec, None, gatherObjNodes, objList, MWALK_ON)
Here's the full code:
db = mgGetCurrentDb() selectList = mgGetSelectList (db) def gatherObjNodes (db, parent, rec, objList): if mgGetCode (rec) == fltObject: print('found object!') objList.append(rec) return MG_TRUE def getObjTOD(rec): attrRec = mgGetAttList(rec,fltObjNoDay, fltObjNoDusk, fltObjNoNight) # tuple print(mgGetName(rec)) print(type(attrRec), attrRec) objList = [] print('Length of list:', len(selectList)) print('code is:', mgGetCode(rec)) if not mgGetCode(rec) == fltObject: print('Selection is not an object') mgWalk (rec, None, gatherObjNodes, objList, MWALK_ON) print('Objects?',len(objList)) for x in objList: getObjTOD(x) else: print('Found FLTOBJECT') getObjTOD(rec)
Thx
Shawn
Shawn
Greetings,
I know mgWalk is used to parse a database, can it also be used to walk the selection (from a Creator script)? How is this done? Let's say
Thanks!
Shawn