bug in name, object(name), list

lohabithi shared this question 1 year ago
Needs Answer

Hello, I have created a worksheet that traces a funicular line through any given set of arbitrary forces. It is a little like tracing a sort of "discrete" differential equation from a set of vectors positioned in the vector fields...

The mechanism works, it still needs some minor refinements but it works. The file attached can be used.

But there is a problem with the mechanism of collecting the input points in a list:

Whenever I save the file after erasing the first vector, it doesn't open again.

This happens quite often, so I made the "init" button to rebuild the missing objects. (missing lists)

But in this case it doesn't work.

Even when I execute manually the first line:

alltexts=RemoveUndefined(Sequence(If(IsDefined(Object("text" + (n))), Object("text" + (n))), n, 1, 500))

it still doesn't work!

It looks like it is a bug in geogebra.

Any help would be welcome!

Comments (6)

photo
1

I forgot to add, that this file is the outcome of the work done by Rami and by me and that was discussed extensively here:

https://help.geogebra.org/t...

But I feel that this issue probably deserves a separate question!

Thanks,

Laurent

photo
1

Hello, I think I got a practical (if not theoretical) answer:

In the "on-click" script of the init button, I add the line:

delete(object)

before each redefinition:

object="..."

and now it works fine.

This probably helps geogebra deal with redefinitions of objects!

photo
1

Well, actually this step of deleting an object before re-defining is probably good, but it was not sufficient.

Finally, I do that:

First, I define the object text1 in the worksheet (as a non-visible, auxiliary object), so it is always present there:

text1="dummy"

Second, I added the 3 following line at the beginning of the script of the init button:

delete(text1)

text1="dummy"

object("text1")


... and it seems that now, these steps really help GGB to get a handle on its list of texts!!!

Any suggestion to make this work better would be most welcome, of course!

I am attaching a slightly better funicular file (but still not final, I have to make a mechanism to avoid forces being counted multiple times, which is rare in normal situations, but still irritating when it happens)

Thanks for help and suggestions from geogebra and math experts,

Laurent

++++++++++++

How to use the funicular worksheet:

- The tool VECTOR 1 adds forces

- forces can be erased, moved by selecting the vector, and modified by moving the points

- the initial point, startP, can be moved (but not erased)

- the initial reaction force: vector startV, and its two points of origin (pole) and end, can be moved, but not erased.

Normally, if (generally after erasing too many forces at a time) the lists disappear, clicking on the "init" button should re-define everything.

photo
1

Hi, a workaround :

- define the input1 and input2 from an inputbox


To delete or add a vector :

1) delete or add within the two inputboxes (after have created new points if add)


2) delete the points not used now (if delete a vector)

photo
1

Bonjour Michel, merci de vous etre penche sur ce probleme etrange!

Je crois que je vais quand meme essayer d'utiliser le dernier fichier que j'ai poste juste au-dessus: "funicular 9-8.ggb", qui a l'air de fonctionner plutot mieux que les precedents.

L'avez-vous vu?

Cordialement,

Laurent

photo
photo
1

Hello, here is the latest file, more or less stable...

Now you can play with the funicular considered as the trajectory of a billard ball hit multiple times... Conservation of the momentum and conservation of force is, after all, the same vectorial sum!

More practically, the "catching radius" allows you to decide which part of the funicular is taking the load and which part is not, by changing the radius or by moving the force along its line of action. Forces can be added anywhere with the special custom tool "vector1", and removed just by deleting them like any other object. Forces can be moved by selecting the vector, and modified by selecting any of the points.

Next step: Using different tags, one can now build several funiculars, resting on each other, and redo parts of Gaudi's structural models! (see "Das Modell, IL 34, 1989).

Yet, if anyone has some suggestion to make the worksheet more stable, it would be very welcome. Because all architects/engineers are not "geeks", and may not be comfortable redoing the lost lists...

Cheers!

Laurent

© 2019 International GeoGebra Institute