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

Get Hotlink Rotation?

Erenford
Booster
Hello, how do I get the hotlink orientation in the module settings? I'm assuming it's in the Group element (API_GroupType) of the hotlink (in group.hlmAngle):

std::vector<API_Element> elemList;
GetElements(elemList, API_HotlinkID); //just a function to get all elements from the given type
size_t count = elemList.size();
for (short i = 0; i < count; i++)
{
	API_Element& elem_hotlink = elemList;
	std::string name = elem_hotlink.hotlink.info;
	if (name != "OFC_TOWER") //filter
		continue;

	API_Element elem_group;
	BNZeroMemory(&elem_group, sizeof(API_Element));
	elem_group.header.typeID = API_GroupID;
	elem_group.header.guid = elem_hotlink.hotlink.hotlinkGroupGuid;
	err = ACAPI_Element_Get(&elem_group);
	if (err != NoError)
	{
		WriteReport("Has an error %d", err);
		continue;
	}
	WriteReport("angle: %f", elem_group.group.hlmAngle);
}
When I ran the code, "elem_group" doesn't have a value. Anyway to do this? This is in AC 17 by the way.

Hotlink_module.png
1 REPLY 1
Erenford
Booster
Ok I finally got the rotation of the hotlink:
elem_hotlink.hotlink.transformation
in the hotlink element's tranmat (didn't see that there before)

My next problem is getting the hotlink module's height according to its story setting of its project.
For ex:
In the hotlink module's own project: in the story setting, the elevation of Ground Floor (GF) is up to 3200.
In the main file: the elevation of GF in the story setting is 3500. The hotlink module (GF) is then placed in the ground floor.

The result will be that the hotlink module is smaller (by 300) than the current story settings. I want to get the hotlink's elevation of 3200. How do I get this? I'm assuming its in the group element API_GroupType->hlmElev, but as I said before the element is empty.
Hotlink_module_2.png