Category block order

I'm trying to re-order the blocks in my OpenSCAD category by directly editing the project xml.

I'm able to do this but it seems that just rearranging block definitions isn't sufficient / wrong way to do this

Do here is my block order

And here is the start of the blocks definition in the .xml file I'm loading in

As you can see, the cube block is 3rd in .xml but showing up way down the list in Snap!

Can anyone shed any light on this?

Not working anymore ???
DefautProject script pic

Its pain to use it as I can only move things up - so if you make a mistoook you have to start again and move all the blocks

Not sure what is the best: This block or editing the .xml :stuck_out_tongue_winking_eye:

Maybe our friend @dardoro could add a new functionality: Move up / Move down

(That would be amazing!)

Actually, I've just been on a little Saturday morning geek online conference and the young 14 year wunderkid has worked out how to just move blocks up 1 (even though they've never seen the Snap! code before and are not a JavaScript programmer!) :slight_smile:

So I'm going to modify @dardoro code to add in the ability to just move a block up or down

Might need to grab another cup of coffee


Would still like to know why manipulating the block definitions in the xml doesn't work though

Share it when it done plz !

Here is 1st go using modified @dardoro JavaScript

It has a few peculiarities (as command blocks are treated differently to reporters) but it's easy to workaround :slight_smile:

I could've sworn custom blocks were made to be ordered alphabetically.

Edit: guess not.

There is a long-outstanding Feature Request to enable users to reorder custom blocks, it was even supported by the High Priest of Snap! himself. The current vote count is 12 (after my endorsement), which already makes it one if the most widely supported FR’s of all (the top outstanding request has received 20 votes, that can’t be too hard to surpass). So, everyone who agrees that being enabled to reorder custom blocks (without hacking) is a good idea: you now know where to cast your vote :slight_smile: .

The vote count is 16 now (and counting).

Cosmetic changes (like sorting of variables/blocks) have never made it to the top of the list in the years I've been using Snap!
And I'll wager a whole £5 that they never will :slight_smile:

I don’t think there is a category: Snap!-related bets :wink:

that would be so useful and helpful lol

Thank you very much, helpful !