addSymbol in References

Discussion about recent product features & solutions!
4 posts • Page 1 of 1
daniel.ponader
Posts:34
Joined: Tue Jan 10, 2012 1:40 pm

addSymbol in References

Post by daniel.ponader »

Dear All,

I created a Panel which adds dynamically some panel references depending on a number of DPE values during initialization, this works fine. This panel shall be placed itself (with different $Parameters) as a panel reference into a "superior" panel several times . So now the addsymbol operation still works, but the positioning values refer to the superior panel. This causes that the positions of the added panel references are completely scrambled. Is there possibility to calculate the offset from the superior panel to the position of the panel reference where the addsymbol operation takes place during runtime in the initialization script ? Or even better, is there an option for the addsymbol function that the position refers to the "own" panel (reference)were it starts from and not to the superior panel?

Thanks in advance

Best regards
Daniel Ponader

nmnogueira
Posts:125
Joined: Thu May 05, 2011 12:59 pm

Re: addSymbol in References

Post by nmnogueira »

Here's what I do:
[ol][*]Place an invisible rectangle in each of the locations of the objects you will add dynamically. Name it appropriately. These rectangles act as placeholders.[*]
[*]In the initialize script, read the position of those rectangles and add the objects in those positions (instead of using a static value).[*][/ol]

Of course this approach does not work in every situation, but so far it has been helpful for me.

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

Re: addSymbol in References

Post by leoknipp »

You can get the position of the own reference by reading the attribute "position".

int x, y;
getValue("","position",x,y);

If your reference contains any object you can also read the position for the objects.

With this information you can calulate the offset of the own reference in relation to the main panel.

Best Regards
Leopold Knipp
Senior Support Specialist

daniel.ponader
Posts:34
Joined: Tue Jan 10, 2012 1:40 pm

Re: addSymbol in References

Post by daniel.ponader »

Thanks for the answers, both solutions are working in fine the desired way. :)

Best regards

4 posts • Page 1 of 1