When I try and access a vector array, I cant see the values. Instead I get something like >>PyIDispatch000000000001234
Scalars work fine, so I converted the strand values and set them as individual xyz scalars and read that in the following script; which works fine, but I'd really like to know how to do it directly from the 'Strandposition' attribute
If anyone can help in any way, I'd be very grateful.
Thanks
Code: Select all
xsi = Application
lm = LogMessage
from win32com.client import constants as c
sel = xsi.Selection
if sel.Count == 0:
lm ('nothing selected')
sel=sel (0)
pntIDs = sel.SubComponent.ElementArray
mesh = sel.SubComponent.Parent3DObject
geom = mesh.ActivePrimitive.Geometry
for eachpoint in pntIDs:
attrs = mesh.ActivePrimitive.Geometry.ICEAttributes;
for attr in attrs:
if attr.Name == "x":
x = attr.DataArray2D [eachpoint]
if attr.Name == "y":
y = attr.DataArray2D [eachpoint]
if attr.Name == "z":
z = attr.DataArray2D [eachpoint]
size = len(x)
curcurve = xsi.SICreateCurve("crvlist", 3, 0)
xsi.CopyPaste(curcurve, "", mesh, 1)
for each in range (size):
xsi.SIAddPointOnCurveAtEnd(curcurve, x [each], y [each], z [each], False, 0, "")