cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

Getting list of elements touching/covering an element

dushyant
Enthusiast

Hi, Is there a way to get a list of elements touching/covering an element? Like there's a wall which has a slab below it touching it - is it possible to know that for any given element?

Thanks.

5 REPLIES 5

bschwb
Enthusiast

Hi!

I haven't tested it but this might do what you want: https://archicadapi.Graphisoft.com/documentation/acapi_element_getcollisions

There's also https://archicadapi.Graphisoft.com/documentation/acapi_element_getrelations but that's mostly used for Zone <-> Element relations and "Element <-> Element of same type" of same type relations.

Bernd Schwarzenbacher
Archicad Add-On Developer
Get (partially free) Add-Ons at www.bschwb.com/add-ons

dushyant
Enthusiast

Hi Bernd, thanks. So with this we need to know both the groups - that is, what we want to check the collision with. And I don't know that in my case. I just have an element which I want to check if it is colliding with anything else. Does that mean all the rest of the elements in the model have to be provided as group no.2 and have it run the check for collision? I was wondering if the API had something more economical. Thanks for these references though!

Yes I think you would need to provide all other elements. Unfortunately I'm not aware of anything else. Maybe you could do some "pre-filtering" by e.g. story, layer, type, etc. depending on what you need. Also it might be that the collision detection is already implemented efficiently and passing "all ellements" isn't to time consuming. Let us know if you run it on a big example how efficient it is! 😉

Bernd Schwarzenbacher
Archicad Add-On Developer
Get (partially free) Add-Ons at www.bschwb.com/add-ons

dushyant
Enthusiast

I used ACAPI_Element_GetSurfaceQuantities() and for the covered parts, I provided all the elements. Yes it is slower.

I feel there should be a way for an element to detect which other elements are protruding into or touching its geometry..

Thanks for reporting back your findings! It's unfortunate that it's that slow. Did you also try it in release mode? Sometimes debug builds are a lot slower with certain operations.
Otherwise I'm out of ideas unfortunately.

Bernd Schwarzenbacher
Archicad Add-On Developer
Get (partially free) Add-Ons at www.bschwb.com/add-ons

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!