2022-09-06 12:00 AM
Hello Everyone!
Can someone please explain how the
GSErrCode ACAPI_Automate ( APIDo_GoToViewID, const char* viewGuidStr );
function can be made not to throw an APIERR_BADPARS error? Where can I find the right GUID to make the function run without an error? I don't see any GUIDs (matching the guid of the navigator view description) in the API_NavigatorView structure, I tried the GUID of the API_NavigatorItem but that throws an error.
Am I making a mistake when I try to make the GUID a const char* this way:
const char* viewGuidStr = APIGuidToString(item.guid).ToCStr();
Any help is appreciated!
Solved! Go to Solution.
2022-09-06 11:16 PM
Hello Everyone!
I think I might have found the solution!
The GUID of the API_NavigatorItem will be accepted by the ACAPI_Automate function if it is converted into GS::Guid and then to const char*.
Seems to work for me!
2022-09-06 09:21 AM
The documentation has an exemple of this:
https://archicadapi.Graphisoft.com/documentation/apido_gotoviewid
2022-09-06 01:40 PM
Thank you for your reply. I've seen the example in the documentation before but as it requires a drawing as a parameter I thought it's a way of opening views put on a layout.
Does this mean that I have to make/link each view to a drawing that I want to switch to before using the goto function? The description of the function says it simulates the action when you open a view from the Project Navigator. From the navigator I can open any views that are not linked to any drawings or layouts by simply clicking it. This part is still not clear to me.
2022-09-06 11:16 PM
Hello Everyone!
I think I might have found the solution!
The GUID of the API_NavigatorItem will be accepted by the ACAPI_Automate function if it is converted into GS::Guid and then to const char*.
Seems to work for me!