Add Symbol Problem

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
3 posts • Page 1 of 1
jeissonsierrac
Posts:62
Joined: Wed Jun 03, 2015 9:37 pm

Add Symbol Problem

Post by jeissonsierrac »

Hello

I'm trying to add a Reference panel with the function AddSymbol, I send some parameters, for example the text that the Panel reference will show, then I need the size of this reference panel to add another panels consequently but when I m going to get the size with the getValue function, this return me the size of the default panel, For example i have a reference panel with a primitive text with "Default" value, I call this reference panel with AddSymbol() and I send the text "hello world" as a parameter to the primitive text to show it , I use getValue to get the size of the reference panel, it returns me the size of the value "Default" instead of the value of "hello world".

fmulder
Posts:330
Joined: Wed Feb 03, 2010 9:46 am

Re: Add Symbol Problem

Post by fmulder »

I'd guess that the following is happening:

* Your'e doing addSymbol() passing it a dyn_string with dollar parameters
* The symbol becomes 'alive' and starts to execute iit scripts
* Your doing a getvalue( "", "size" ) even before the script has finished setting the value to 'Hello world'

Just for testing :try doing a delay(1) just after the addSymbol(). This would confirm my suspicion.

The problem could be that the script in the newly added symbol runs asynchronously to the script adding that symbol. What you could do is set the text from the script that does the addSymbol() (so do not pass as dollar code, but write the shape directly).

In addSymbol(0 you specify the name of the newly added shape. When your shape is called TESTSHAPE then you should be able to do:

dyn_int diSize;
setValue( "TESTSHAPE.MyTextField", "text", "Hello World' );
getValue( "TESTSHAPE.MyTextField", "size", diSize );

Good luck

share the fun
Frenk Mulder.

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Add Symbol Problem

Post by leoknipp »

Hello,

in this case you want to get the size of an object and not the size of a reference panel.
If the size of objects is changed dynamically you have to read the new size of the object after changing the size as Frenk Mulder has described.

This needs alsways taken into account and not only when using reference panels.

Best Regards
Leopold Knipp
Senior Support Specialist

3 posts • Page 1 of 1