Open a List of Geogebra commands as a file?

scampsd shared this question 6 years ago
Answered

Good morning,

I am trying to show a list of line segments, built up of different points.

In my environment, those points look like (just the first line:

    {[[76.3168,37.8511],[76.3118,37.8562]][[76.3118,37.8562],[76.3118,37.8612]][[76.3118,37.8612],[76.3067,37.8663]][[76.3067,37.8663],[76.6115,37.8714]]}

I have already converted this into:

    Segment[(76.3168,37.8511),(76.3118,37.8562)]

    Segment[(76.3118,37.8562),(76.3118,37.8612)]

    Segment[(76.3118,37.8612),(76.3067,37.8663)]

    Segment[(76.3067,37.8663),(76.6115,37.8714)]

As you can see, this looks like the Input commands of Geogebra.


I am now searching for a way to enter those commands into Geogebra. I have already managed to do this manually one by one, and this works fine, but as I have 88 of such lines, this gets annoying after a while :(


I had hoped that it might be possible to edit the *.ggb file, but as this is a binary file, no editing seems to be possible.


Does anybody know a way to load a list of input commands into Geogebra?

Thanks a lot

Comments (6)

photo
1

Hi,


with the list of points list1={(73,37),(74,38),(76,39),(78,41)}


input

Sequence[Segment[Element[list1,i],Element[list1,i+1]],i,1,Length[list1]-1]

photo
1

Hi


I love spreadsheet..! :confused:


https://ggbm.at/569287

photo
1

Thanks, Patrick and Jumera. You have made my day :)


I have slightly modified my data, by removing the parentheses and adding TAB characters between the numbers.

Then I have copied those numbers into the spreadsheet (like this, I have two columns, one for X and one for Y coordinates).

Using right mouse button in the spread sheet, I have created a list of points out of my data.

Then, using Patrick's command, I have managed to create my polygon.

photo
1

The Execute command works for multiple lines of input:


    Execute[{"Segment[(76.3168,37.8511),(76.3118,37.8562)]",

    "Segment[(76.3118,37.8562),(76.3118,37.8612)]",

    "Segment[(76.3118,37.8612),(76.3067,37.8663)]",

    "Segment[(76.3067,37.8663),(76.6115,37.8714)]"}]


but if you'd rather have the objects grouped, you can create a list with curly brackets


    {Segment[(76.3168,37.8511),(76.3118,37.8562)],

    Segment[(76.3118,37.8562),(76.3118,37.8612)],

    Segment[(76.3118,37.8612),(76.3067,37.8663)],

    Segment[(76.3067,37.8663),(76.6115,37.8714)]}

photo
1

Thanks, Patrick and Jumera. You have made my day :)


I have slightly modified my data, by removing the parentheses and adding TAB characters between the numbers.

Then I have copied those numbers into the spreadsheet (like this, I have two columns, one for X and one for Y coordinates).

Using right mouse button in the spread sheet, I have created a list of points out of my data.

Then, using Patrick's command, I have managed to create my polygon.

If you look my file,

i created segments in spreadsheet..!

E1=Segment[D1, D2] and drag formula down

photo
1

Hi, another method.


Create a button

Paste the commands in the button script.

Click the button

Delete the button if required


Simon

© 2021 International GeoGebra Institute