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

APIDo_​GoToViewID

SzokeFerenc
Booster

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

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!

View solution in original post

3 REPLIES 3
julienK
Advocate

The documentation has an exemple of this:

https://archicadapi.Graphisoft.com/documentation/apido_gotoviewid

 

 

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.

Solution

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!

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!