Properties not available in Python? 2004-07-04 - By Bernard Lebel
Back Thanks Olivier,
The example I gave was on 3 polygon spheres. I also tried to log the parent and name property, to no avail. The only thing that worked is to log the object itself, wich returns its name or the index depending of the type of iteration.
Bernard
>From: "OO's mailbot" <mailbot@(protected)> >Reply-To: XSI@(protected) >To: XSI@(protected) >Subject: Re: [Script] Properties not available in Python? >Date: Sat, 3 Jul 2004 16:46:53 +1000 > >Bernard, try with another language. some XSI objects don't actually have a >fullname property. so depending on the selection that code will fail in >all languages. > >OO > >On Jul 3, 2004, at 4:28 PM, Bernard Lebel wrote: > >>Thanks Guy. >> >>But I still get the same error... :-( >> >> >>Bernard >> >> >> >>>From: "Guy Rabiller" <guy@(protected)> >>>Reply-To: XSI@(protected) >>>To: <XSI@(protected)> >>>Subject: Re: [Script] Properties not available in Python? >>>Date: Fri, 2 Jul 2004 22:21:22 +0200 >>> >>>Better use this: >>> >>>for iSel in Application.Selection: >>> >>> Application.LogMessage(iSel.FullName) >>> >>>-- >>>guy rabiller | 3d technical director @ LaMaison >>> >>> >>>-- -- Original Message -- -- >>>From: "Bernard Lebel" <atyss4si@(protected)> >>>To: <XSI@(protected)> >>>Sent: Friday, July 02, 2004 8:49 PM >>>Subject: [Script] Properties not available in Python? >>> >>> >>> > Hello, >>> > >>> > Trying out some ultra basic things in Python, in this case I'm trying >>>a doc >>> > example letter for letter, and it doesn't work! :-( >>> > >>> > From "Groups, Colleciton and Array" (XSI 3.5.11 docs): >>> > >>> > # >>>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- - >>> > oSelList = Application.Selection >>> > >>> > for iSel in range(oSelList.Count): >>> > Application.LogMessage(oSelList.Item(iSel).FullName) >>> > # >>>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- - >>> > >>> > When I run this code, I get this error: >>> > >>> > #ERROR : "Traceback (most recent call last): >>> > # File "<Script Block >", line 4, in ? >>> > # Application.LogMessage(oSelList.Item(iSel).FullName) >>> > # File "C:\Python23\Lib\site-packages\win32com\client\__init__.py", >>>line >>> > 454, in __getattr__ >>> > # raise AttributeError, "'??????' object has no attribute >>>'????????1'" >>> > (repr(self), attr) >>> > #AttributeError: '<win32com.gen_py.Softimage|XSI Object Model Library >>> > v1.5.X3DObject instance at 0x557334576>' object has no attribute >>>'FullName' >>> > # - [line 454]" >>> > >>> > >>> > I mean, what the...? >>> > >>> > >>> > >>> > Thanks >>> > Bernard >>> > >>> > >>> > --- >>> > Unsubscribe? Mail Majordomo@(protected) with the following text in >>>body: >>> > unsubscribe xsi >>> > >>> > >> >> >>--- >>Unsubscribe? Mail Majordomo@(protected) with the following text in >>body: >>unsubscribe xsi > > >--- >Unsubscribe? Mail Majordomo@(protected) with the following text in body: >unsubscribe xsi
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|