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

How to use APIDo_GoToViewID with a NavItem?

Joel Buehler
Enthusiast

hehey evrybody! 

 

The ACAPI_Automate Call has this cool feature where you can call "APIDo_GoToViewID" 

 

https://archicadapi.graphisoft.com/documentation/apido_gotoviewid?s=APIDo_GoToViewID

 

and there are even a few posts about this method:

 

https://community.graphisoft.com/t5/Archicad-C-API/APIDo-GoToViewID/m-p/355172

 

this one is very helpfull since it says exactly waht to do: Convert a API_Guid to as GS::Guid and then to a c string. 

But unfortunaltly waht ever i do, i allways get a  APIERR_BADPARS error. i tried evry possible flavour, no luck. 

 

example:

API_Guid to GS::Guid with "APIGuid2GSGuid(guid1)", then GS::Guid to GS::String with "ToString()" and then to const char * with "ToCStr()"

 

 

i retrieve the GUID of the navigator item trough APINavigator_SearchNavigatorItemID and im using the navItem.guid.

i want to open a NavItem and not go trough an API_Element like in the example. 

 

does anyone have a tipp? 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Joel Buehler
Enthusiast

 @SzokeFerenc was so nice to help me out with this one: 

 

GS::Guid itemGuid = APIGuid2GSGuid(item.guid);
char guidStr[256] = "0";
GSErrcode err = itemGuid.ConvertToString(guidStr);

 

Thank you very much!! 🙂 

View solution in original post

1 REPLY 1
Solution
Joel Buehler
Enthusiast

 @SzokeFerenc was so nice to help me out with this one: 

 

GS::Guid itemGuid = APIGuid2GSGuid(item.guid);
char guidStr[256] = "0";
GSErrcode err = itemGuid.ConvertToString(guidStr);

 

Thank you very much!! 🙂