Re: Python: Getting and setting view visibility

2013-01-25 Thread Dan Yargici
OK, a little help here... This parameter gymnastics gets me every time. I've tried all manner of variants with no success. Select an object and then run this: from win32com.client import dynamic xsi = Application pr = xsi.LogMessage for oObj in xsi.Selection: oOverride =

Re: Python: Getting and setting view visibility

2013-01-25 Thread Dan Yargici
Indeed it does! Try this however, and it fails again. Seems it's a quirk with AddProp. Strange... for obj in Application.Selection: over = obj.AddProp(Override, oObj, , Vis_Override) param = obj.Properties(Visibility).Parameters(viewvis) over.AddParameterEntry(param) On Fri, Jan

Re: Python: Getting and setting view visibility

2013-01-25 Thread Peter Agg
Ah yeah, looking at the docs AddProp uses those funky ISIVTCollection things to return a collection for obj in Application.Selection: over = Application.AddProp(Override, obj, , Vis_Override)[Value][0] param = obj.Properties(Visibility).Parameters(viewvis)

Re: Python: Getting and setting view visibility

2013-01-25 Thread Dan Yargici
Aaaah, OK, I see. I'll try and burn that into memory. Cheers Peter. DAN On Fri, Jan 25, 2013 at 2:10 PM, Peter Agg peter@googlemail.com wrote: Ah yeah, looking at the docs AddProp uses those funky ISIVTCollection things to return a collection for obj in Application.Selection:

Re: Python: Getting and setting view visibility

2013-01-25 Thread Martin Chatterjee
Dan, alternatively you should be able to just use the OM method: for obj in Application.Selection: over = obj.AddProperty(Override, False, Vis_Override) LogMessage(over.FullName+ -- +str(over.Type) ) Cheers, Martin -- Martin Chatterjee [ Freelance Technical Director ] [

Re: Python: Getting and setting view visibility

2013-01-25 Thread Martin Chatterjee
All right guys, sometimes it helps to read the whole thread... :) Peter already mentioned *obj.AddProperty()* a few mails earlier - feel free to ignore my last mail... Cheers, Martin -- Martin Chatterjee [ Freelance Technical Director ] [ http://www.chatterjee.de ] [

Python: Getting and setting view visibility

2013-01-23 Thread Christian Gotzinger
Hi list, I don't understand why this won't work. Consider the following 1-liner: *print Application.Selection(0).Properties(Visibility).viewvis.Value* This works as expected. But when I try this: *for obj in Application.Selection: print obj.Properties(Visibility).viewvis.Value* I get an

Re: Python: Getting and setting view visibility

2013-01-23 Thread Stephen Blair
for obj in Application.Selection: print hasattr( obj.Properties(Visibility), viewvis ) for i in range( Application.Selection.Count ) : print hasattr( Application.Selection(i).Properties(Visibility), viewvis ) print '#' import win32com.client for obj in

Re: Python: Getting and setting view visibility

2013-01-23 Thread Stephen Blair
https://groups.google.com/d/msg/xsi_list/NSV-e-thdtY/d9Vp49sZAzUJ On 23/01/2013 9:32 AM, Stephen Blair wrote: for obj in Application.Selection: print hasattr( obj.Properties(Visibility), viewvis ) for i in range( Application.Selection.Count ) : print hasattr(

Re: Python: Getting and setting view visibility

2013-01-23 Thread César Sáez
The explicit form always work, a bit more to type but it's more reliable IMHO. print Application.Selection(0).Properties(Visibility).*Parameters* (viewvis).Value On Wed, Jan 23, 2013 at 3:46 PM, Stephen Blair stephenrbl...@gmail.comwrote:

Re: Python: Getting and setting view visibility

2013-01-23 Thread Christian Gotzinger
Thank you for the explanations Stephen and César!