Linking a FIELD to a Block Count

Linking a FIELD to a Block Count

seedstudiolandscapedesign
Enthusiast Enthusiast
14,774 Views
39 Replies
Message 1 of 40

Linking a FIELD to a Block Count

seedstudiolandscapedesign
Enthusiast
Enthusiast

Is it possible to display an autoupdating block count by using a FIELD in a TABLE?  

 

I've looked but I can't seem to find the information, any input is appreciated.

0 Likes
Accepted solutions (2)
14,775 Views
39 Replies
Replies (39)
Message 21 of 40

maxim_k
Consultant
Consultant
Welcome to Autodesk Forums!

Hi Moin,
>>>>>Use data extraction method to update block count after updating blocks update data table
I'm afraid it is not possible in AutoCAD for Mac, only on PC side you can link extracted data to a table in the drawing.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 22 of 40

prousseauCQJ6U
Advocate
Advocate

I know it's already been 3 years, but is there a way to make this work with dynamic blocks?

0 Likes
Message 23 of 40

jimmykta
Explorer
Explorer

This is awesome, thank you. Is there a way to do the same but count the blocks from an xref file instead from a live file? Thanks!

0 Likes
Message 24 of 40

maxim_k
Consultant
Consultant
Welcome to Autodesk Forums!

Hi Jimmy,
>>>>Is there a way to do the same but count the blocks from an xref file instead from a live file?
Just open externaly referenced drawing and count blocks in it.


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 25 of 40

Anonymous
Not applicable

Hi, I am using Audodesk Civil 3D 2019. I've been using the recount.lsp to link a field to a block count for a while and it works great with one exception that the field value resets to zero at some unknown time. For example, I have a block as a legend item and saved as an xref. Let's say I have 10 blocks and the field correctly counts 10 blocks; great it works. However, the field then somehow resets by itself to a zero value. Even though I haven't added or subtracted any blocks from that drawing, the only way to get the count is to type recount as regen doesn't update the count either. This lisp works great in counting my specified blocks but the issue is that I can't seem to keep the field value as it resets to zero. Is there a way to prevent autocad from resetting the value to zero and to keep the current count of the blocks running? I would really appreciate a solution. Thank you. 

0 Likes
Message 26 of 40

maxim_k
Consultant
Consultant
Welcome to Autodesk Forums!

Hi @Anonymous,

You are posting in AutoCAD for Mac Forum, but ask about Civil 3D.
Civil 3D Forum is here:
https://forums.autodesk.com/t5/civil-3d-forum/bd-p/66

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 27 of 40

Anonymous
Not applicable

Hey,

 

Is there a way to edit this to work with dynamic blocks? I am a total noob at lisp? Much thanks 🙂

Message 28 of 40

Anonymous
Not applicable
That’s a great question. It doesn’t seem to work for me. Anyone else?
0 Likes
Message 29 of 40

pendean
Community Legend
Community Legend
It depends on what the FIELD is counting... Most likely not.

FYI the dedicated dynamic blocks forum is here, why don't you start your own topic there for help https://forums.autodesk.com/t5/dynamic-blocks-forum/bd-p/154
0 Likes
Message 30 of 40

Anonymous
Not applicable

Thanks for your fast reply. Is there a solution for my question as I also work with this lisp on my AutoCAD for Mac? I understand that a solution for this platform may not work elsewhere. So I would be asking the same question specific to AutoCAD for Mac. Is there a solution so that the field does not reset itself to zero? Thank you

0 Likes
Message 31 of 40

yael.vsh
Enthusiast
Enthusiast

Hi Maxim,

Your answers in this thread were very helpful.

I was able to successfully implement the solution in the thread you provided and created a table that counts the number of block instances in a drawing and is able to update it via field with a diesel expression.

I also have the need to apply the solution to a file that has multiple XREFs in it.

I would like my table to have fields with sum of amount of instances of blocks across all those XREFs.

Your solution of opening each XREF is not a good fit for me since I'd like to get a sum. (And not sum it up manually).

Any ideas on LISP modification?

0 Likes
Message 32 of 40

prousseauCQJ6U
Advocate
Advocate

Hi Yael,

 

AutoCAD 2022 now has this feature built-in, you should look into it!

0 Likes
Message 33 of 40

yael.vsh
Enthusiast
Enthusiast

Hi

Wow, cool, thanks so much!

Unfortunately my workplace works with 2013 😑

0 Likes
Message 34 of 40

maxim_k
Consultant
Consultant

Hi @prousseauCQJ6U ,

 

>>>>>AutoCAD 2022 now has this feature built-in, you should look into it!

 

Not AutoCAD for Mac. Only PC version has this new feature.


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 35 of 40

yael.vsh
Enthusiast
Enthusiast

I have regular Autocad. Happened to reply in this thread because this was the topic I was looking for 🙂

But still 2013.

0 Likes
Message 36 of 40

akhtar4223
Enthusiast
Enthusiast

Hi Maxim,

The RECOUNT lsp is working very fine for me, thanks for the same.

Please refer attached drawing in which i am using RECOUNT. I have a table on layout space which shows the total count of block in Quantity column. 

My request is that can i get the total count value in text where i have currently mentioned "--"

 

Thanks & RegardsLight_Fixture_Table.JPG

0 Likes
Message 37 of 40

maxim_k
Consultant
Consultant

Hi @akhtar4223 ,

 

You have to place FIELDs with DIESEL expressions instead of MTEXT in these columns.

Plus you need to modify Recount lsp so that it contains the names of all the blocks you want to count and assign these names to separate environment variables which are read by the Diesel expressions in the FIELDs.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 38 of 40

akhtar4223
Enthusiast
Enthusiast
Thank you very much...added expression so now it works as i want.
0 Likes
Message 39 of 40

akhtar4223
Enthusiast
Enthusiast

Hi Maxim,

I have dynamic blocks in my drawing. RECOUNT is not counting those blocks. I have attached my drawing and the LSP. Request you to help on the same.

Block with name "LC" has visibility and block with name "LL" has dynamic parameter.

0 Likes
Message 40 of 40

maxim_k
Consultant
Consultant

Hi Akhtar,

 

As I wrote before: this LISP doesn't support Dynamic blocks.

And because AutoCAD for Mac doesn't support Visual lisp functions the code for counting Dynamic blocks in "vanilla LISP" would be very complex.

I believe it is possible to add such code based on, for example, these code examples:

http://www.lee-mac.com/effectivename.html

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes