Python introspection... 2005-06-13 - By Jerry Gamache
Back I think getattr if what you want, especially with something in the third argument:
Application.LogMessage(help(getattr)) oObj = Application.Selection(0) if getattr(oObj, "Properties", None): Application.LogMessage("Yea") else: Application.LogMessage("Nay")
-- --Original Message-- -- From: owner-xsi@(protected) [mailto:owner-xsi@(protected)]On Behalf Of Bernard Lebel Posted At: Monday, June 13, 2005 7:43 AM Posted To: xsi Conversation: Python introspection... Subject: Re: Python introspection...
Well, that's idea. There is no way to know what the user has selected, so the script has to filter out invalid selected objects.
Cheers Bernard
Hans,Veenendaal,AMplus R&D,SOJ wrote:
>This works for me. > >App = Application >for obj in App.Selection: > Test = obj.LocalProperties > LogMessage(str(obj) + " has " + str(Test.Count) + " local properties") > >If this fails than you have things selected that are not SceneItem >derived objects... > >
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|