Counting Blocks within an given Object

Counting Blocks within an given Object

ian.schultz
Explorer Explorer
860 Views
7 Replies
Message 1 of 8

Counting Blocks within an given Object

ian.schultz
Explorer
Explorer

Hello dear People of the Autodesk-Forum!

 

First of some Info about me and the system I use:

-I am and technical-product-design-Aprentice in my second (out of 3.5years) year of Vocationaltraining.

-In our Buisness we use AutoCAD 2021

-We are using Windows 10
-I work on an professional CAD-Workstation PC, newly build in 2020

-My first language is German so i hope everything is translated correctly (should there be any confusion,     translation wise,  please let me know 🙂 not only to state my problem correctly but also to further better my english speaking Capabilities)

 

 

I may need your help here!

 

Problem: I need to find a way to count the number of different Blocks within a given Object.

 

Background:

Our Buisness produces Paneling/covers to put inside light-Commercial-Vehicle´s Stowages.

To make creating partslists of single-part-Drawings (and Assembly-Drawings) less prone to Errors and also way easier, we want to establish the useage of Blockdefinitions and -refferences. I already converted the (for example) boreholes and other Objects  into simple Blocks. Since the amount of Screws (# of screws = # of boreholes) will be refferenced, not only in the Assembly drawing but the single-part-Drawing also, I need to find a way to define a space/Object (outer Contour of the Paneling) and be able to count how many of wich Block are placed in that given Object. Maybe there is something similar to the Textfield command that lets you select an Object and shows you (for example) the Area or length/circumference of the Object you have selected and also Updates the Data when changes are made.

Up until now i did not find a way to specify an Object/Space in wich the blocks are supposed to be counted.

but I am sure it is way easier than I think or i am just too bad at looking for the right command.

 

I am excited to find out if you guys are able to help me out here 🙂

0 Likes
Accepted solutions (1)
861 Views
7 Replies
Replies (7)
Message 2 of 8

ВeekeeCZ
Consultant
Consultant

"Problem: I need to find a way to count the number of different Blocks within a given Object."

 

What type of entity is your Object. Is it also a block?

If possible sample dwg would be helpful.

0 Likes
Message 3 of 8

marko_ribar
Advisor
Advisor

https://www.theswamp.org/index.php?topic=57773.msg611181#msg611181 

Marko Ribar, d.i.a. (graduated engineer of architecture)
Message 4 of 8

Kent1Cooper
Consultant
Consultant

If the "given Object" is a Polyline, there are examples in this Forum of routines to find everything inside one, but with the possible complication of not necessarily getting it right if the Polyline contains arc segments [some of them have attempts at compensating for that].  However, I don't know of a way to get the result of such a routine to update when changes are made, other than to run it again.

Kent Cooper, AIA
0 Likes
Message 5 of 8

pendean
Community Legend
Community Legend
0 Likes
Message 6 of 8

Sea-Haven
Mentor
Mentor
Accepted solution

It sounds like a custom request, one of my recent ones for a client counts and makes a table for various types of objects, blocks of same name are counted, plines are counted based on area, multi lines are counted based on length. 

 

It is the usual problem with quantity output, starts with one request and the final solution is 5 versions later.

 

Counting objects within a shape is not a problem from a code point of view.

 

There are many here that could do the custom code for you keeping your dwg's confidential but that has a price. Sometimes Beer money. 

 

Really need a dwg with a sample output to see what you want.

 

Like pendean have a look at "dataextraction" as a 1st step.

 

 

0 Likes
Message 7 of 8

john.uhden
Mentor
Mentor

@pendean 

I didn't see anything in your link about counting objects within a boundary.  Is that included but not mentioned?

Our latest version at work is C3D 2020.

John F. Uhden

0 Likes
Message 8 of 8

ian.schultz
Explorer
Explorer

Thats it!

I had to use a data-extraction-table, using 3rd-party API´s isnt an option sadly.  it took me a while to grasp the concept. The Table allows us to also connect with other databases. This sollution may not be pretty looking but it works well.

thanks to everyone for your help 🙂

0 Likes