There is an idea to design zones in the archicad arcade to which ceilings and walls will automatically be attached

There is an idea to design zones in the archicad arcade to which ceilings and walls will automatically be attached. I was stuck on the moment with the correct binding of the internal walls to the external walls. Any ideas how to correctly tie the internal walls?
unfortunately I can’t attach the archicad file (
The outer wall is anchored to the zone through the text value of the thickness of the wall.
Скрипт Стены по зонам.gh (34.5 KB)