Following the advice on the topic Listing Properties, I made the following piecec of code:
for (i = 0; i < entityIds.length; i++) { entity = doc.queryEntity(entityIds); Entity_ID = entity.getId(); Entity_ID = Entity_ID.toString(); for (j = 0; j < entityIds.length; j++) { table_ID = widgets["Obj_table"].item(j, 0); table_ID = table_ID.text(); //Quando encontrar, só altera draworder. (Não é uma questão de 'Se' porque já foi feito refresh) if (Entity_ID == table_ID){ entity.setDrawOrder(j); break; //Breaks out of loop } } //Adiciona parametros à entidade vl_ModEntities.addObject(entity, false); //False = force new parametres var draw = entity.getDrawOrder(); draw = draw.toString(); appWin.handleUserMessage(draw); }
The code succeeds in altering the draw order according to the order of a list i manipulated, however the changfes are not permanent. If I close, and reopen the file, the program will automatically reorder draworder and even change the entity ID of the entities, leaving its drawing order in the original order.
Here is what I did:
I created two lines, shaping a corner, then copy pasted it two times. as before, the order went to hell, but after a refresh (that used the code above to sort it out) and a reordering of the table to an order or my choosing, it was all OK.
I saved, Reopened it and the draworder had been reworked as well as the entity Ids. The printscreens in anex show the process: 1st Refresh
Ordered table and Refresh. (Note the ID of the first entity selected)
Close and Reorder (and note the Id of the same entity as before)
Is there a way to make these changes permanent?
Thank you.