I have discovered that setting the value of a constant actor to the expression getContainer().getName will retrieve the name of the next level up container. But, the constant actor only evaluates the expression when the expression changes, not when the constant fires. Therefore, if the name of the container changes, the old name will be output by the constant, not the new name.<div>
<br></div><div>I know that Ptolemy offers a Name Parameter that does the reverse of what I want--it sets the name of the container. But then the container cannot be easily re-instantiated or copy-pasted because the new instance gets the name set by the Name Parameter (which doesn't seem to check for, or gracefully, handle name collisions).</div>
<div><br></div><div>I have tried to use the getContainer().getName in an Expression actor and in a Python actor to get the expression to be evaluated at run time but neither of those actors recognizes the function.</div><div>
<br></div><div>I understand that I could create a constant equal to the string I'm trying to retrieve but I was hoping to use the rename command accessed by right clicking on the container to provide a smoother, more consistent user interface.<br clear="all">
<br></div><div>So, is there a way to programmatically retrieve the name of an actor's container?</div><div><br></div><div>Thanks,</div><div>Bob Weber<br><br>
</div>