[proFit-list] changing text in a text object programmatically

Kurt Sutter kurt at quansoft.com
Mon Jun 16 06:58:27 CDT 2014


There is, in fact, a work-around. Just create a shape object, then set its text attribute:

o = pf.GetShapeObject(shape = 'psi_ID’)
...
o.text = ’this text'
…
o.text = ‘other text’

Best regards

Kurt Sutter
QuantumSoft

On 16 Jun 2014, at 9:12, Chris Lee <laserboy at fusemail.com> wrote:

> thanks Peter. Pity you can’t do a mixed mode script :)
> 
> On 15 Jun 2014 (W: 24), at 18:10, Peter Amrhein <peter at quansoft.com> wrote:
> 
>> Dear Chris
>> 
>> Unfortunately, there is a bug in SetShapeProperties when called from a Python script, i.e. the shape can't be found.
>> It will be fixed with the next 6.2 release.
>> 
>> As a work around you may want to delete the text shape and create a new one for each frame.
>> (Also, the command should work properly in Pascal script.)
>> 
>> Regarding on how you call SetShapeProperties from a Python script:
>> Correct - using 'shape = ' is the parameter to identify the shape by name:
>>      pf.SetShapeProperties(shape = "psi_ID", text = psi_string)
>> Wrong - undefined shape; 'name = ' is the parameter to change it's new name, but does not identify it:
>>      pf.SetShapeProperties(name = "psi_ID", text = psi_string)
>> 
>> Best regards,
>> 
>> Peter Amrhein
>> Quantum Soft
>> 
>> 
>> On 13.06.2014, at 13:42, Chris Lee <laserboy at fusemail.com> wrote:
>> 
>>> Actually, I think something very strange is happening.
>>> 
>>> If I change the shape name, the second option, pf.SetShapeProperties(name = ‘X’, text = some_string), worked once. If I change the name again, it doesn’t seem to work.
>>> 
>>> I also note that if I change the shape name, its position shifts…
>>> 
>>> 
>>> On 13 Jun 2014 (W: 24), at 13:33, Chris Lee <laserboy at fusemail.com> wrote:
>>> 
>>>> Hi All,
>>>> 
>>>> I’m making a movie of a graph. I calculate my data, put it in a window, graph the results. It all works fine (and creates lovely movies). Now, I want to put the parameters that are varying over the course of the movie in the graph.
>>>> 
>>>> I created two text boxes, named “psi_ID” and “delta_ID” Since I know their names, I should be able to call them directly.
>>>> 
>>>> I use: 
>>>> 
>>>> psi_string = "Psi = " + `j` + "°"
>>>> pf.SetShapeProperties(shape = "psi_ID", text = psi_string)
>>>> 
>>>> 
>>>> This fails with the error that it cannot convert parameter to desired type. I think this refers to the first argument. If I change it to 
>>>> 
>>>> pf.SetShapeProperties(name = "psi_ID", text = psi_string)
>>>> 
>>>> This fails with the error “No such shape” (I have checked the shape name)
>>>> 
>>>> Can anyone see what I am doing wrong here?
>>>> 
>>>> Cheers
>>>> Chris 
>>>> _______________________________________________
>>>> proFit-list mailing list
>>>> proFit-list at quantum-soft.com
>>>> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com
>>> 
>>> _______________________________________________
>>> proFit-list mailing list
>>> proFit-list at quantum-soft.com
>>> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com
>> 
>> _______________________________________________
>> proFit-list mailing list
>> proFit-list at quantum-soft.com
>> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com
> 
> _______________________________________________
> proFit-list mailing list
> proFit-list at quantum-soft.com
> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://quantum-soft.com/pipermail/profit-list_quantum-soft.com/attachments/20140616/8b8ad7d3/attachment.html>


More information about the proFit-list mailing list