Good afternoon all,
I was wondering if someone out there might have an answer to my question... which has been annoying me for a while now...
Is there anyway to have a dynamic block which utilises a similar function to TCOUNT. I am doing drawings for solar panel installations and have set up a dynamic block for our different panels that we use, which i have used xy paramater with the array action to make life simple when inserting panels onto a drawing... however we number these panels 1 to ~ ... we could have 3 on one roof but we could also have over 100... is there any way to have the dynamic block auto increment the text automatically? At the moment i use the block to show 20 panels then i explode and use the tcount command to increment the text in selection order.
Or... another thought does anyone know how i could go about doing lets say a data entry for example insert block-> Dialogue for amount of panels / amount of panels in a row or column? And after selecting that data the block will automatically have numbers 1-x...
I have attached a sample block so you can try and get an understanding of what im after. Any help would be appreciated.
My experience with Dynamic Blocks is pretty limited but I did attempt to do what you are describing by using attributes and/or fields. However, my findings are that it does not seem to be possible to automatically increment numbering in the different panels within the dynamic block. I believe that this is the inherent in the way arrays and dynamic blocks work, although the new associative array in 2012 does allow you to replace items in the array with different items.
So in my opinion you may just need to rely on numbering the panels outside of the dynamic array. I looked at the TCOUNT express tool and it does provide some good functionality, but it seems to have some shortcomings when it comes to specifying how the text entities are being numbered. With that in mind I put together an AutoLisp application that essentially combines creating a rectangular array of text entities and then substitutes the text with numbers. There seems to be greater control over how the text entities are numbered unless you are trying to number in some unusual non-rectangular pattern. The application also provides the added functionality of using decimal numbers, which I credit that idea to Lee Mac who is a frequent contributor on this forum.
So try modifying a copy of your dynamic block to remove the text component, and then use the attached NumArray.lsp application. Open the lisp file in Notepad to read more about it and the features. It is also helpful to set your Object Snap setting to Midpoint, Extension, and Apparent Intersection along with turning on the Object Snap Tracking, so that you can snap to a panel midpoint intersection when choosing the start and end points for the number array.
The functionality of the application could certainly be modified or expanded to replicate an array of panels (or the block of your choice) in addition to the numbering. However, I think the fuctionality the application, in addition to your dyanmic array is adequate and perhaps less complicated.
Thanks. You're welcome.
You may also want to check a couple of programs which Lee Mac created that deal with incremental numbering:
Both programs can be used to increment a number within a block that includes an attribute definition, which is applicable to the original post on this topic, as well as other features. I have only briefly checked out these programs, but they certainly show that there are all sorts of possibilities or functionality that can be created within a lisp program.
Many thanks for sharing those Gavin, i'll give them a try. New start to the year and a new start at menu making .
Happy New Year to you all. Here is hoping its a good one!
I just found out a good way of incrementing text and having it be dynamic with a table. Use a table and insert a formula in one of the cells with an expression that references another cell with modifications (ex =(A10+2)). This cell can be copied within the table similar to excel.
Access a broad range of knowledge to help get the most out of your products and services.