matt.antone
May 15th, 2009, 02:49 PM
I have a function that I am calling onclick. when I call that function, the window variable comes back empty.
def getListItem():
try:
window = mc.GetActiveWindow()
list = window.GetList(200)
curListItemID = list.GetFocusedItem()
curListItems = list.GetItems()
curListItem = curListItems[curListItemID]
#aListItem = getList().getSelectedPosition()
except Exception, e:
print "error getListItem() "+str(e)
print "curListItem:: "+repr(curListItem)
return curListItem
The error I get is:
NOTICE: error getListItem() 'NoneType' object has no attribute 'Window_GetList'
This seems to be consistent with a lot of the objects in mc.py when using them in an external .py. I can get a similar error with GetActiveWindow(), GetList(), GetItem(). Anyone else having problems with the mc.py functions?
def getListItem():
try:
window = mc.GetActiveWindow()
list = window.GetList(200)
curListItemID = list.GetFocusedItem()
curListItems = list.GetItems()
curListItem = curListItems[curListItemID]
#aListItem = getList().getSelectedPosition()
except Exception, e:
print "error getListItem() "+str(e)
print "curListItem:: "+repr(curListItem)
return curListItem
The error I get is:
NOTICE: error getListItem() 'NoneType' object has no attribute 'Window_GetList'
This seems to be consistent with a lot of the objects in mc.py when using them in an external .py. I can get a similar error with GetActiveWindow(), GetList(), GetItem(). Anyone else having problems with the mc.py functions?