License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…

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

AddOn functions call back

poco2013
Mentor
I believe it is possible to call one plugin from another. Is it possible to call a function within one plugin from another plugin ?

if so, any documentation?

I am asking out of convenience. If one compiles and loads the Example plugins. One could easily create a new addon which could directly call those pre-defined functions without having to cut/paste the function and all its resources?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
poco2013 wrote:
I believe it is possible to call one plugin from another. Is it possible to call a function within one plugin from another plugin ?
Yes, it's possible. You can find detailed documentation for this topic here: http://archicadapi.graphisoft.com/documentation/communication-manager

Let's call the plugin which has the function as "Server Add-On" and the plugin which calls that function as "Client Add-On".
The "Client Add-On" can call only those functions from "Server Add-On" which have been registered with ACAPI_Register_SupportedService function in the RegisterInterface function of the "Server Add-On". That function tells ARCHICAD that the Add-On can be called by another and it gives an identifier for the registered function. So the "Client Add-On" will be able to use that identifier (+ the MDID of the "Server Add-On") to call it.
Feel free to choose any identifier. The type of the identifier is GSType (=UInt32).

View solution in original post

3 REPLIES 3
poco2013
Mentor
There is a example in the Communications Manager that calls the Do place Text function in the Communication client addon.

But it uses a command identifier of 'CmID to identify the text command.
Where is this identifier assigned? Is it something you have to program or is it pre-assigned.
Say I wanted to call a function from the Element_Test Add-On? How would I assign a identifier to a particular function in that add on so that I could call it from ACAPI_Command_Call()??
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
poco2013 wrote:
I believe it is possible to call one plugin from another. Is it possible to call a function within one plugin from another plugin ?
Yes, it's possible. You can find detailed documentation for this topic here: http://archicadapi.graphisoft.com/documentation/communication-manager

Let's call the plugin which has the function as "Server Add-On" and the plugin which calls that function as "Client Add-On".
The "Client Add-On" can call only those functions from "Server Add-On" which have been registered with ACAPI_Register_SupportedService function in the RegisterInterface function of the "Server Add-On". That function tells ARCHICAD that the Add-On can be called by another and it gives an identifier for the registered function. So the "Client Add-On" will be able to use that identifier (+ the MDID of the "Server Add-On") to call it.
Feel free to choose any identifier. The type of the identifier is GSType (=UInt32).
poco2013
Mentor
Thanks for the documentation Reference.

That explains the required hook-up fairly well. I tried it out and it seems to work OK.

Thanks
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27