• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

sorting more flexible block attributes

Hockrim

Guest
Save to all, I have several blocks that contain from 50 to 100 attributes each and should order them according to a logic given that the blocks were created by selecting the attributes all together with a window instead of selecting them one by one in the desired order.
I am currently using the _battman command but it turns out very rigid, because I should select the attribute and click on the relative button to move it where I want and this for 50-100 attributes.
my question is: is there no other way (maybe with the famous express tools) to speed up the order of attributes, perhaps with the drag&drop selecting them more than one at a time? what the _battman command does not allow to do and there is risk of wrong.
In a nutshell, I would need an implementation of the _battman command.
Thank you.
 
uses autocad command ordattblock.you have to call it back inside the block editor.
do not forget to update the blocks already inserted with the command sincatt!
[edit: anche se effettivamente non si discosta molto dal funzionamento di battman o battorder.... :-( ]
 
Last edited:
the excel file attached, via the button <seleziona blocco=""> (additional components) selected the block in autocad, creates a sheet and lists tags and values.
the obtained list can be ordered at will so as to have the desired sequence, the column serves to enter numerical values to be used as a sorting key.
change of values (column c) makes it more convenient to edit everything.
the button <refresh blocco=""> change the block attributes in autocad.
By saving the excel file, to the next use of the same block, the order previously created is preserved by allowing the management of the attributes without worrying about how they were created.
in tools/references of vba associate the right bookcase of autocad.
n.b.: Select a block at a time.</refresh></seleziona>
 

Attachments

uses autocad command ordattblock.you have to call it back inside the block editor.
do not forget to update the blocks already inserted with the command sincatt!
[edit: anche se effettivamente non si discosta molto dal funzionamento di battman o battorder.... :-( ]
already tried, in fact it is almost the same thing.
 
Thank you.
the excel file attached, via the button <seleziona blocco=""> (additional components) selected the block in autocad, creates a sheet and lists tags and values.
the obtained list can be ordered at will so as to have the desired sequence, the column serves to enter numerical values to be used as a sorting key.
change of values (column c) makes it more convenient to edit everything.
the button <refresh blocco=""> change the block attributes in autocad.
By saving the excel file, to the next use of the same block, the order previously created is preserved by allowing the management of the attributes without worrying about how they were created.
in tools/references of vba associate the right bookcase of autocad.
n.b.: Select a block at a time.</refresh></seleziona>
Thank you, I try and let you know.
 
if you have version 2022 or 2021, autocad 2021 type library, to descend each version has the equivalent.Immagine 2022-05-19 140245.webp
 
if you have version 2022 or 2021, autocad 2021 type library, to descend each version has the equivalent.View attachment 65615
I guess it should be done inside the excel vba editor and not autocad, and then how do you use the file? I don't have to open it in excel, how do I associate the block to edit? Thank you in advance.
 
I tried the excel file of rpor66: does not order the attrbuti when I refresh block, if instead I write in the value field then fill it. How come?
 
Last edited:
once you get the list of tags/values, it is up to you to put in order the excel sheet, operation to do at the first use of the block, then the values will be read and written according to the tag and not sequentially.
 
once you get the list of tags/values, it is up to you to put in order the excel sheet, operation to do at the first use of the block, then the values will be read and written according to the tag and not sequentially.
Good morning, sorry if I didn't make myself feel but I had a weekend of fire (in all senses seen the temperatures).
I think I did everything right, these are the steps I do, maybe I'm wrong something:
1) I open both excel and block files
2) I start the macro blockage and select the block in autocad
3) order attributes from excel file to my liking
4) I start macro refreshblocco
In this way it should also update the order instead update only if I write something in the value column but the order of attributes remains the original one.
 
what the program does is precisely eliminate the need to order attributes in the blocks leaving the task to the excel. every time you select from excel the same type of block, the values will be sorted and the editing you carry out on excel.
If you want to have the block with the ordered attributes, it does not do to your case.
 
what the program does is precisely eliminate the need to order attributes in the blocks leaving the task to the excel. every time you select from excel the same type of block, the values will be sorted and the editing you carry out on excel.
If you want to have the block with the ordered attributes, it does not do to your case.
then maybe I didn't understand the use of excel file: So you're telling me that if I have a block with 50 randomly ordered attributes and I wanted to order them from 1 to 50 I can't do it by editing the excel fie?
and if I can't do that to what would the excel file then, only to help enhance the labels?
 
after selecting the block, in the excel sheet a sheet has been added with the block name.
order, save, "valorize labels", close the dwg.
open a new dwg, select the block with the same name as the previous one, do not add a new sheet, the value fields already ordered are updated.
to this serves the xlsm file, it is like a dialog where the sequence of attributes is stored in excels regardless of that in autocad.
 
after selecting the block, in the excel sheet a sheet has been added with the block name.
order, save, "valorize labels", close the dwg.
open a new dwg, select the block with the same name as the previous one, do not add a new sheet, the value fields already ordered are updated.
to this serves the xlsm file, it is like a dialog where the sequence of attributes is stored in excels regardless of that in autocad.
Ah, now I understand, so I will always need the xlsm support file. Well, come on, better than nothing is. even if I needed the order of attributes to be done in autocad because those who issue the block do so within a dwg containing various instances of that block and must value them with always different data between one and the other.
another thing: what do the other 2 macros newbarra and eliminatebarra?
Thank you.
 
on the various instances; the program, after selecting the block, stores the unique code of the insert entity, then reads the data of that instance of the block, which you can edit as you think, always from excel, when you will refresh will be modified only that instance.
by selecting another instance, the values of the attributes will be copied in the file already ordered and you can edit them using the order already executed.
I explain more technically: the definition of the block is stored in a separate table from the entities of the current design, along with the definition of the attributes; when inserting the block into the design is added the insert entity formed by a list containing the link to the block table, plus the copy of the attributes. then, if you then redefine the block, change the block but not the attributes of the already inserted blocks that are a copy and not a link; that's why you don't need to reorder the attributes through the block editor, it only works with the new inserts.
the add-ons menu is created by the newbar macro whenever you activate the sheet, deletebarra serves to delete everything when you close the file or move to another excel file.
greetings
 
on the various instances; the program, after selecting the block, stores the unique code of the insert entity, then reads the data of that instance of the block, which you can edit as you think, always from excel, when you will refresh will be modified only that instance.
by selecting another instance, the values of the attributes will be copied in the file already ordered and you can edit them using the order already executed.
I explain more technically: the definition of the block is stored in a separate table from the entities of the current design, along with the definition of the attributes; when inserting the block into the design is added the insert entity formed by a list containing the link to the block table, plus the copy of the attributes. then, if you then redefine the block, change the block but not the attributes of the already inserted blocks that are a copy and not a link; that's why you don't need to reorder the attributes through the block editor, it only works with the new inserts.
the add-ons menu is created by the newbar macro whenever you activate the sheet, deletebarra serves to delete everything when you close the file or move to another excel file.
greetings
Thank you, very clear and exhaustive explanation, but it's not what I needed, it would have been very convenient if in excel the order of attributes was also updated.
I asked for this because I am changing blocks containing 40 already ordered attributes and I have to add as many and recreate the block by clicking the attributes one by one in the order in which I want including the 40 already ordered, or order them through the ordattbloc or _battman command, which is not very flexible. Couldn't you implement the xlsm file so that it does? Thanks again.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top