Page 1 of 1

Different name for Graphic line

Posted: Thu Apr 21, 2016 6:41 am
by kevin007
Hi All,

Using the below code I draw line, my problem is each time name of the lines is same, Is it any way to change it, If the name already is there the name should change. eg: If the line name is LI then when I draw new line it's name change to LI1 and so on. How I solve this problem ?

Code: Select all

set the style of the templateGraphic to "line" 
choose graphic tool 
set the name of the templategraphic to "LI"
Thanks
Kevin

Re: Different name for Graphic line

Posted: Thu Apr 21, 2016 10:06 am
by Klaus
Did you already count all the line graphics in your stack(s)?
(Hint, hint!) 8)

Re: Different name for Graphic line

Posted: Thu Apr 21, 2016 3:38 pm
by dunbarx
Or you can create a naming scheme, and use the "last" keyword. Read about this in the dictionary. Now read about the "lastGraphic" message.

So if you had a custom property that held the number of line graphics you create, you can easily

Code: Select all

on lastGraphic
set the graphicCount of this card to  the graphicCount of this card + 1
set the name of last grc to "Line" & the graphicCount of this card
end lastGraphic
Do you know what a custom property is?

Craig Newman