getDefinitionString returns empty string

AhmadHakroosh shared this question 3 years ago
Needs Answer

I was trying to use getDefinitionString function to retrieve pen strokes as arrays of points (JS), surprisingly I did not work on versions 5.0.377.0 and 5.0.374.0, It returns an empty string.


Is that a functionality bug?

Comments (5)

photo
1

try {vertex[stroke1]}


I think it is a polygon-line


saludos

photo
1

What do you mean by {vertex[stroke1]}?

vertex isn't an object into ggbApplet or in the global scope.

photo
1

{vertex[<polygon>]} is the set of vertexes of polygon

if your stroke is stroke1 then list={vertex[stroke1]} creates the list of points through the stroke

you can use it in GGscript with setvalue for create a list of points defining the stroke

if you need JS you can use ggbApplet.evalCommand("setValue[list,{vertex[stroke1]}]") (or text instead list)

photo
photo
1

Hi, can you join a file with your script ? Try mine, as a workaround with the mathmagic idea.


  1. list1=copyFreeObject[{vertex[stroke1]}]

and the script :


  1. text1=ggbApplet.getValueString('list1')

    alert(text1+“”)

photo
1

I might did not explain the case well, so let me explain:


I have a JS file (javascript code), that tries to parse a drawn pen stroke on the applet.

and using the function ggbApplet.getDefinitionString('stroke1') does not returns the string of the points, it returns an empty string.

I am not using the script into GeoGebra, I use the browser javascript console.

a screenshot:

b4555dc54ec51a69dadf28193cd5922f

© 2021 International GeoGebra Institute