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.
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! 😉
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.