Good afternoon to all, i need help if its possible on following problem, the user generates the shape from external data, it becomes messy when he selects several rows and drops them to the page.
Each box represents a type of data, represented in a custom MDTYPE field that can be S, C, R or V in that order (there may be 4 or any of them) .
I would like to achieve, (I was not successful) select, according to MDTYPE is S for example, and sort them to the right, then look for if there is MDTYPE C and sort them under S, also to the right.
In attached document, you can find pictures about for more details.
If its is possible, It would save me a lot of time, since I have to order many diagrams like this manually and it won't be programmed. I have tried to follow some examples of the forum, but I have not even been able to select the shape according to the custom MDTYPE

Thank you very much in advance.
Lu