Archicad C++ API
About Archicad add-on development using the C++ API.

Get all doors on a zone. [RE-OPEN]

ReignBough
Enthusiast
I am able to get the doors on a zone using ACAPI_Element_GetRelations(API_RoomRelation). But what I found out is that this is applicable to doors where its face/surface touches the edge of a zone.

I am having trouble now getting the doors where they are in the middle of two zones. (see attached image)

doors.jpg
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
5 REPLIES 5
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
In API19 ACAPI_Element_GetRelations function is extended and you can call it for doors and windows also.
Example code:
API_Element			doorElement;
API_DoorRelation	doorInfo;

//...

err = ACAPI_Element_GetRelations (doorElement.header.guid, API_ZombieElemID, &doorInfo);

if ((doorInfo.toRoom == myRoom1Element.header.guid && doorInfo.fromRoom == myRoom2Element.header.guid) ||
	(doorInfo.toRoom == myRoom2Element.header.guid && doorInfo.fromRoom == myRoom1Element.header.guid)) {
	// this door is in the middle of myRoom1Element and myRoom2Element
}


If you check this for each door then you can get all doors on the zone.
ReignBough
Enthusiast
Thanks Tibor. I forgot to tell that I am currently working on AC17 but I will take note on this when I start the conversions.
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
ReignBough
Enthusiast
I started converting my add-on to 18 and found out that the said API_DoorRelation structure does not exist.
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
ReignBough wrote:
I started converting my add-on to 18 and found out that the said API_DoorRelation structure does not exist.


I'm really sorry! It's my fault, unfortunately this new feature with this structure was implemented only in API19. So you have to wait for it few more month.

I updated my previous post.
Anonymous
Not applicable
I am able to get the doors on a zone using ACAPI_Element_GetRelations(API_RoomRelation). But what I found out is that this is applicable to doors where its face/surface touches the edge of a zone.