BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Archicad C++ API
About Archicad add-on development using the C++ API.

mapId is reset to 0 (API_UndefinedMap) [SOLVED TEMPORARILY]

ReignBough
Enthusiast
I don't know if this is a bug or intentional. Here is the code:
navi_map_id = API_PublisherSets;
//...
set.mapId = navi_map_id;
set.wantsExtraInfo = (navi_map_id == API_PublisherSets) ? 1 : 0;
DBPrintf("1 - set.mapId: %d (%d)", set.mapId, navi_map_id);
err = ACAPI_Environment(APIEnv_GetNavigatorSetID, &set, &i);
DBPrintf("2 - set.mapId: %d (%d)", set.mapId, navi_map_id);
And here is the output:
1 - set.mapId: 5 (5)
2 - set.mapId: 0 (5)
As you can see, the value of set.mapId was reset to 0.
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
3 REPLIES 3
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi,

The set is a local object, so if you change it's mapId it won't affect the application's navigator set.
That's why it gives you the unmodified mapId if you get the navigator set again with APIEnv_GetNavigatorSetID.

Why do you want to change the mapId?

Best Regards,
Tibor
ReignBough
Enthusiast
If my understanding is correct, ACAPI_Environment(APIEnv_GetNavigatorSetID) will retrieve the information of a navigator set determined by the mapId. But if the returned information gives me a value of 0 in the mapId (which is API_UndefinedMap) after I called the function, this means that the navigator set that was returned to me is undefined (or unknown).
Tibor wrote:
Why do you want to change the mapId?
I am not changing the mapId. I just want to check and/or use the value of the mapId after the call. But it became 0.
~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
Hi,

I've checked that, and you're right.

ACAPI_Environment(APIEnv_GetNavigatorSetID,…) function retrieves only the following informations of the navigator:
name, guid, rootGuid and path if it's exists.

Unfortunately it always sets the mapId property to 0. But the mapId is an input parameter here, so you should know it before calling the function.
Anyway, we will fix this bug in the next API version, the output's mapId will be the same as the input's mapId of course. Thanks for pointing out this issue!

Regards,
Tibor Lorántfy
Learn and get certified!

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!