Jose Gemez (wo may still be lurking these forums?) was developing some tools that from memory could do this sort of thing.
Medusa and Dragon they were called.
Do some searching here and you may find something.
I'm not sure if they were ever released but here is a link to his web site for Medusa.
http://www.garquitectos.es/bim/archicad-medusa-gdl/
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11