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

automatic progressive numbering associated with block insertion

mlm81

Guest
I would need an automatic numbering associated with the blocks, that is to be able to insert in the blocks of the numbering indices that are updated as the blocks are inserted in the model. i.e., I have to draw a photovoltaic field consisting of a number of y strings (blocks) with x panels each and I want that, inserting the strings in the model, automatically, the panels are numbered progressively from 1 to x*y...is there anything like that?
thanks anyway to everyone!
 
Last edited by a moderator:
Maybe I found what he does for you...
the block "pannello.dwg" contains an example of 10 attributes representing the panels, but can be even more.
before inserting the panel block, the program does a control and checks what is the panel with the highest progressive number existing in the drawing. Once you find the number, the block is inserted with the attributes that start from the highest number found and adds 1 and below the others.
 

Attachments

I didn't hurt the moderators of this forum if I was post-consecutive, but I realized there was a bug in my program, which didn't go running if it didn't find at least one panel. so I rewrote the routine by inserting the initial values of the attributes as pre-assigned and then modifying them with the vla-put-textstring function.
 

Attachments

I tried it and it's actually exactly what I needed! I'm trying to customize the block, exploiting the tags that you entered (I'm pressing that I've never used them in reality, I'm just documented in these days of search), i.e. copying them in the block that I really need, the only thing is that if I add new ones the command doesn't work anymore, while if I copy and take off your numbering is no longer in order but they reverse the numbers that I have glued. Unfortunately I don't know him, but if you explain what and where to change I can try! thank you very much anyway, for your availability, you practically created me a tailor made program! :
 
the program makes a check and check what is the panel with the highest progressive number existing in the drawing.
Maybe it was enough to count panel blocks, this to save some resources, count n blocks is a speech, read each block, verify the value etc definitely takes more time.

Of course that on this example the difference may not be heard, but if we talk about large numbers then the speech changes.

cmq compliments for the proposed solution.
 
In fact, the blocks need to be a little 'to tame', in the sense that the determining factor is to indicate the tags as preassigned otherwise the program does not work.
As for the issue of inversion of numbers, once you enter the block, you can use the battman command to fix tags in the order you want. clearly this operation is valid only for the inserted block, not the one stored as a standing design. in this case it is better to start from scratch and create a new block with all the tags sorted as they are created. then depends on how many types of blocks you use. a further improvement could be a dialog box with the choice of the block to use. I have already created a .dcl file similar to the rename of the blocks, it would be enough to recycle it and adapt it.
 

Forum statistics

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

Members online

No members online now.
Back
Top