SOLVED!
AddOn functions call back

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-02-18
10:05 PM
- last edited on
2022-10-04
04:39 PM
by
Daniel Kassai
2019-02-18
10:05 PM
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?
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
Windows 11 - Visual Studio 2022; ArchiCAD 27
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-02-19 10:02 AM
2019-02-19
10:02 AM
poco2013 wrote:Yes, it's possible. You can find detailed documentation for this topic here:
I believe it is possible to call one plugin from another. Is it possible to call a function within one plugin from another plugin ?
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).
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-02-19 02:13 AM
2019-02-19
02:13 AM
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()??
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
Windows 11 - Visual Studio 2022; ArchiCAD 27
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-02-19 10:02 AM
2019-02-19
10:02 AM
poco2013 wrote:Yes, it's possible. You can find detailed documentation for this topic here:
I believe it is possible to call one plugin from another. Is it possible to call a function within one plugin from another plugin ?
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).

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-02-19 12:17 PM
2019-02-19
12:17 PM
Thanks for the documentation Reference.
That explains the required hook-up fairly well. I tried it out and it seems to work OK.
Thanks
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
Windows 11 - Visual Studio 2022; ArchiCAD 27