To fellow vtk users,<div><br></div><div>I am stuck on this, and wonder if anyone has any tricks up their sleeves to solve this.</div><div><br></div><div>I would like to create objects on the fly. Specifically, I want to create sphere actors on the points that the user picks in my displayed mesh. At the moment, my EndPickEvent function is a bit like this, where picked_node stores the picked node number:</div>

<div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">                </span>dynamicName = &#39;infoText%s&#39; %picked_node   # Make the name dynamic, and numbered according to the picked node. E.g label = infoText1</div>

<div><span class="Apple-tab-span" style="white-space:pre">                </span>print &#39;dynamicNAme before: &#39;,dynamicName</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>dynamicName = vtk.vtkVectorText()</div>

<div><span class="Apple-tab-span" style="white-space:pre">                </span>print &#39;dynamicNAme after: &#39;, dynamicName</div></div><div><div><br></div><div>I want to make an actor with the dynamic name, but when I create the VectorText, it is called dynamicName, and not the string that I assigned to dynamicName. I understand why this doesn&#39;t work, but how do I make it work?</div>

<div><br></div><div>Do you know how I can achieve this?<br><br></div><div>Thanks so much!</div><div>-- </div><div>Helvin <br><br>Tags: dynamically create objects in vtk dynamic actors creation on the fly<br>
</div></div>