cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to get the all elements in a hotlink?

Hi.
In Archicad API,is there a function that gets all element of a hotlink?
I can't seem to find that in the API (sorry, perhaps I'm not looking hard enough)
1 Solution

Accepted Solutions
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi,

There isn't a function like that, but it's easy to write one:
GS::Array<API_Guid> GetElementsInHotlink (const API_Guid& hotlinkGuid) {
	GS::Array<API_Guid> elementsInHotlink;

	GS::Array<API_Guid> elemList;
	ACAPI_Element_GetElemList (API_ZombieElemID, &elemList);
	for (const API_Guid& elemGuid : elemList) {
		API_Elem_Head elemHead = {};
		elemHead.guid = elemGuid;
		ACAPI_Element_GetHeader (&elemHead);
		if (elemHead.hotlinkGuid == hotlinkGuid)
			elementsInHotlink.Push (elemGuid);
	}

	return elementsInHotlink;
}

Go to post

1 Reply 1
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi,

There isn't a function like that, but it's easy to write one:
GS::Array<API_Guid> GetElementsInHotlink (const API_Guid& hotlinkGuid) {
	GS::Array<API_Guid> elementsInHotlink;

	GS::Array<API_Guid> elemList;
	ACAPI_Element_GetElemList (API_ZombieElemID, &elemList);
	for (const API_Guid& elemGuid : elemList) {
		API_Elem_Head elemHead = {};
		elemHead.guid = elemGuid;
		ACAPI_Element_GetHeader (&elemHead);
		if (elemHead.hotlinkGuid == hotlinkGuid)
			elementsInHotlink.Push (elemGuid);
	}

	return elementsInHotlink;
}

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!