For my taste you have to many blocks inside blocks, mixture of static and dynamic block and this makes writing code too complex. To stick blocks together you can use group command. When you change pickstyle variable (0 1) it either holds all grouped entities together or enable moving. Create dummy block with two attributes Ordnum and indice.
Read sequence from the CSV place dummy blocks as needed and replace arguments Ordnum and indice. SOmething like that.
Miljenko Hatlak
I understand, grouping is not possible, the blocks already come like this because they extract information from several databases, once I have them with that information I need to make the changes in the mentioned attributes, this in order to use them in a additional process without losing most of the original properties, seeing your comment, I don't know if it is easier to extract the CSV, manually edit these attributes there and then insert the CSV or Excel again to make the change.
It's hard to tell when I don't know whole the processm but I would definitively extract data from the databases, create sequences or even join that data to single csv and run creation of the blocks from it.
Miljenko Hatlak
@Dan-Rod wrote:
....
Give sequence starting from 1 to the last block for the “INDICE” attribute starting from left to right and from bottom to top. ....
For the sorting into order, you may be able to use BlockSSSort.lsp, >here<. From a Selection Set of Blocks, it can give you a list of entity names, Sorted as you specify, which you can then step through in order, in assigning Attribute values. In your case, if I understand correctly, I think the usage would be:
(bsss "b" "l")
that is, sort starting with the bottom row, going from left to right along that row, then successive rows moving upward. It could do the left column first from bottom up, then successive columns moving rightward, if that's what you really mean, by switching the "b" and "l".
See comments at the top of the file.