License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

how to get the all elements in a hotlink?

Anonymous
Not applicable
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 ACCEPTED SOLUTION

Accepted Solutions
Solution
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;
}

View solution in original post

1 REPLY 1
Solution
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;
}