2023-01-05 04:36 PM
Dear Graphisoft Community,
I'm trying to write an AddOn which changes the Hotlink Master ID, but im having trouble to find the property for hotlink elements. Neither the hotlink node nor the hotlink elements seem to have the value.
So i was wondering if someone here knows how to access the Hotlink Master ID and edit it idealy.
Thanks for any Help!
Kind Regards
Dayiz
Solved! Go to Solution.
2026-02-17 12:19 PM
I think the comment at filler_3 is a mistake. All fields prefixed with 'filler' are only padding to maintain the structure size and byte alignment - they never contain data and will probably be filled with zeros by default (hence appearing to be an empty string).
The listing ID for an element (element info string) is now held in API_ElementMemo::elemInfoString. You can write changes to the memo structure with ACAPI_Element_Change, but be careful to set the mask for this value accordingly. I haven't tried (because I've never had to set the master ID) but I assume this is also true for API_HotlinkType elements.
Note that you can read the element info string by calling ACAPI_Element_GetElementInfoString. You can also read the combination of master ID and element info string with ACAPI_Element_GetCompoundInfoString, so you could deduce the master ID by stripping the element info from the compound info.
2023-01-05
05:30 PM
- last edited on
2026-02-16
03:57 PM
by
Laszlo Nagy
A bit more Information:
i was able to find the property (it is a built in property) and if i select an element, get it and then proceed to get the property, i can receive the Hotlink Master-ID. But for some reason I'm not able to set it.
So another question: am I able to edit built in properties with c++ addons?
My Code:
API_SelectionInfo selI;
GS::Array<API_Neig> neig;
ACAPI_Selection_Get(&selI, &neig, false);
if(neig.GetSize() == 0)
{
break;
}
API_Element elem;
elem.header.guid = neig.GetFirst().guid;
ACAPI_Element_Get(&elem);
Toolbox tb;
API_PropertyDefinition propDef;
tb.findPropertyDefinition(propDef, "Hotlink Master-ID", "ID und Kategorien");
API_Property propValue;
ACAPI_Element_GetPropertyValue(elem.header.guid, propDef.guid, propValue);
API_Property newPropValue;
newPropValue.definition = propValue.definition;
newPropValue.value.singleVariant.variant.type = propValue.definition.valueType;
newPropValue.value.singleVariant.variant.uniStringValue = (GS::UniString)"Renamed MasterID";
newPropValue.isDefault = false;
GS::Array<API_Guid> guidList;
guidList.Push(elem.header.guid);
ACAPI_ElementList_ModifyPropertyValue(newPropValue, guidList);
ACAPI_Element_SetProperty(elem.header.guid, newPropValue);
I tried to set the value with SetProperty and ModifyPropertyList, both didn't work. My guess is, that the Hotlink-Master ID is saved somewhere else and the property of the element just points to the value. But how can i edit that value? Where is it saved?
2023-01-06
02:20 PM
- last edited on
2026-02-16
03:58 PM
by
Laszlo Nagy
So, I dug a bit deeper and found the following:
As it seems, the Master-ID is saved at filler_3 (to my surprise, there is no mention of it in https://archicadapi.Graphisoft.com/documentation/api_hotlinktype ).
So I converted it to a string and tried to print it out with DG::InformationAlert, but i only receive an empty string. Why does it behave that way? Where is the master-id saved? I'm so confused and there are no ressources that cover the master-id
2026-02-16 11:09 AM
I´m with you, years dealing with this issues and always I ending hand crafting.
¿have you got the correct script?
thanks
2026-02-16 04:01 PM
If you select a placed Hotlink in Archicad, right-click and go to the Hotlink Settings Dialog, is the Master ID field filled out with some value? Because if it is not, there is only an empty string that the API can return.
2026-02-17 12:19 PM
I think the comment at filler_3 is a mistake. All fields prefixed with 'filler' are only padding to maintain the structure size and byte alignment - they never contain data and will probably be filled with zeros by default (hence appearing to be an empty string).
The listing ID for an element (element info string) is now held in API_ElementMemo::elemInfoString. You can write changes to the memo structure with ACAPI_Element_Change, but be careful to set the mask for this value accordingly. I haven't tried (because I've never had to set the master ID) but I assume this is also true for API_HotlinkType elements.
Note that you can read the element info string by calling ACAPI_Element_GetElementInfoString. You can also read the combination of master ID and element info string with ACAPI_Element_GetCompoundInfoString, so you could deduce the master ID by stripping the element info from the compound info.
2026-02-17 04:46 PM - edited 2026-02-17 04:48 PM
Hi,
The comment is not valid any more; filler_3 used to contain the master ID when it was not filler_3 🙂
Best, Akos