<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yes! (banging forehead) Thanks very much, Cory.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 11, 2017, at 11:10 PM, Cory Quammen <<a href="mailto:cory.quammen@kitware.com" class="">cory.quammen@kitware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div dir="ltr" class="">Randy,<div class=""><br class=""></div><div class="">Try setting a name on the array with</div><div class=""><br class=""></div><div class=""><span style="font-size:12.8px" class="">scalars.SetName('array_name')</span><br class=""></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">This should let you select this array as the color array in ParaView.</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">- Cory</span></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Oct 11, 2017 at 9:48 PM, Heiland, Randy <span dir="ltr" class=""><<a href="mailto:heiland@iu.edu" target="_blank" class="">heiland@iu.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I create the following in the Pgmable Source in PV, but cannot figure out how to color the resulting points or 3D glyphs using the scalar values. What am I missing?<br class="">
-Randy<br class="">
<br class="">
# Get a vtk.PolyData object for the output<br class="">
pdo = self.GetPolyDataOutput()<br class="">
<br class="">
# Create points<br class="">
num_pts = 3<br class="">
newPts = vtk.vtkPoints()<br class="">
scalars = vtk.vtkFloatArray()<br class="">
<br class="">
xval = -1.0<br class="">
for idx in range(0, num_pts):<br class="">
# rf. PhysiCell User Guide for these array indices to a cell's position.<br class="">
x = xval<br class="">
y = 0.0<br class="">
z = 0.0<br class="">
newPts.InsertPoint(idx, x,y,z)<br class="">
sval = xval*2<br class="">
scalars.InsertNextValue(sval)<br class="">
xval += 1.0<br class="">
<br class="">
# Add the points to the vtkPolyData object.<br class="">
pdo.SetPoints(newPts)<br class="">
pdo.GetPointData().SetScalars(<wbr class="">scalars)<br class="">
<br class="">
verts = vtk.vtkCellArray()<br class="">
for idx in range(0, num_pts):<br class="">
verts.InsertNextCell(1)<br class="">
verts.InsertCellPoint(idx)<br class="">
<br class="">
pdo.SetVerts(verts)<br class="">
<br class="">
<br class="">
<br class="">______________________________<wbr class="">_________________<br class="">
Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/<wbr class="">opensource/opensource.html</a><br class="">
<br class="">
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank" class="">http://paraview.org/Wiki/<wbr class="">ParaView</a><br class="">
<br class="">
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank" class="">http://markmail.org/search/?q=<wbr class="">ParaView</a><br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank" class="">http://public.kitware.com/<wbr class="">mailman/listinfo/paraview</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Cory Quammen<br class="">Staff R&D Engineer<br class="">Kitware, Inc.</div>
</div>
</div></blockquote></div><br class=""></div></body></html>