Thanks! It's weird though that I fundamentally do the same thing and I'm getting errors when trying to do a per-point context.
On Tue, Sep 10, 2013 at 7:21 PM, Vincent Ullmann < [email protected]> wrote: > Did you saw this example from the dosc? > > http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/si_om/ICEAttribute.DataArray.html > (2. Example) > > Here is a little Snipped i wrote some time ago. > Note: It works only with a Cube. Not with a NonFrezzedPointCloud > > [snip] > from win32com.client import constants as c > xsi = Application > > # Debug > obj = xsi.Selection[0] > > # Create and/or get Attribute > attr = obj.ActivePrimitive.AddICEAttribute("Test", c.siICENodeDataLong, > c.siICENodeStructureSingle, c.siICENodeContextComponent0D ) > > # Populate a List > valueArray = [] > for i in range(attr.ElementCount): > valueArray.append( i*i ) > > # Set List as DataArray > attr.DataArray = valueArray > [/snip] > > > Am 10.09.2013 23:46, schrieb Alan Fregtman: > > What about non-singleton attributes like say a per-point integer? I can't > get those to be set. I can work around it in my case, but I'm curious why > it won't work like the docs appear to imply. > > > > On Tue, Sep 10, 2013 at 2:36 PM, Alan Fregtman <[email protected]>wrote: > >> I missed those posts. Thanks Stephen! :) >> >> >> >> On Tue, Sep 10, 2013 at 1:49 PM, Stephen Blair >> <[email protected]>wrote: >> >>> >>> http://xsisupport.com/2012/11/13/scripting-writing-the-dataarray-of-an-ice-attribute/ >>> http://xsisupport.com/2013/03/25/aha-setting-dataarray2d-with-jscript/ >>> >>> >>> On Tue, Sep 10, 2013 at 1:40 PM, Alan Fregtman >>> <[email protected]>wrote: >>> >>>> Hey guys, >>>> >>>> So I called the AddICEAttribute() method, and on its returned >>>> attribute I can't seem to set its .DataArray property with a simple list of >>>> integers. It logs this: >>>> >>>> *# WARNING : 3392 - Invalid offset specified while extracting data >>>> from this attribute: <Attribute: myCustomAttr>* >>>> *# <Offset: 0>* >>>> >>>> ...but I'm not extracting anything! I'm trying to SET the data. >>>> >>>> Is there a secret trick to it? I'm trying to use Python. >>>> >>>> Thanks in advance. >>>> Cheers, >>>> >>>> -- Alan >>>> >>>> >>> >> > >

