How can I get all selected objects on scripts?

hzabc shared this question 1 year ago
Needs Answer

I want to get all selected objects on scripts, or get all the points on scripts, how can I do?

Much thanks.

Comments (2)

photo
1

Please explain overall what you are trying to do

photo
1

Hi Michael,

Tank you. For some reason we need to bulk processsome objects or its label, for example, rename or set color. So I think it will be useful if we can get all selected objects, or all of some specified kind of objects.

Following is some code but for all objects:

var length = ggbApplet.getObjectNumber();

var i = 0;

var names = new Array();

for (i = 0; i < length; i++) {

names = ggbApplet.getObjectName(i);

ggbApplet.renameObject(names, "prefix" + names)

}

© 2023 International GeoGebra Institute