Communicating with an external program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-03-01
09:36 AM
- last edited on
‎2022-10-04
04:36 PM
by
Daniel Kassai
Currently I have written an add-on that packs the necessary data into an .xml that the standalone can read, and the standalone creates material attributes as an .xml that Archicad can read. This works, but is horribly tedious to the user, who should be ideally able to click a button in the standalone to perform these actions automatically.
I've tried to make a named pipe connection, but I'm presented with 2 bad options: either the process runs on the AC main thread and blocks user interaction, or runs on the background in a separate thread, but cannot access the element database because AC hasn't been built with multi-threading in mind.
So, what to do? I know Grasshopper manages to do this somehow, but don't have a clue how. Implementing the whole standalone program as an Archicad add-on isn't viable: it would require rewriting the whole program in C++, and the user interface itself is rather complicated.
- Heikki Malkki / M.A.D.
Solved! Go to Solution.
- Labels:
-
Add-On (C++)
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-03-02 09:24 AM
You can see this function with no crash in multi-threading: ACAPI_Command_CallFromEventLoop.
You can omit this function if you don't need to operate the AC database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-03-02 01:21 AM
https://grpc.io/
https://thrift.apache.org/
I think you could also use web-sockets and find the right library for your particular language case.
Joel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-03-02 09:24 AM
You can see this function with no crash in multi-threading: ACAPI_Command_CallFromEventLoop.
You can omit this function if you don't need to operate the AC database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-03-05 12:08 PM
XML might be garbage, but since I've already got it for file-based transfers and have C++ on the one end and C# on the other, anything more sophisticated at this point would be wasted effort. "It does the job."

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-06 04:06 AM
Just a question..... Would this functionality you talk of work in the case of a live connection with the parameters of a selected object? I struggle with the limited scope of the default UI in the selection setting dialog box. I would love to have an external program running that could read & write into the parameters of a GDL object. The UI layout could then be whatever you wanted it to be. I'm not concerned about archicads base elements (walls/roofs etc) but rather the presentation and adjustments of parameters within custom GDL objects. Thanks
Residential Designer based in Tauranga, NZ
Archicad v9+
VR enthusiast.
Always wants more!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-06 02:01 PM
gavinNZz wrote:Could you clarify the context in which you would like to modify parameters, i.e. broadly the application within a specific workflow? That function will be applicable to many workflows, but not all.
Would this functionality you talk of work in the case of a live connection with the parameters of a selected object?
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-07 12:13 AM
Ralph wrote:Basically when a custom object is selected at any point in a workflow it would, through an AC add-on, expose its parameters to a xml file which would be read and written to by the external software which in turn would feed updated parameters back into the XML and, through the AC add-on, the object would be updated.
gavinNZz wrote:Could you clarify the context in which you would like to modify parameters, i.e. broadly the application within a specific workflow? That function will be applicable to many workflows, but not all.
Would this functionality you talk of work in the case of a live connection with the parameters of a selected object?
Grasshopper achieves this functionality but uses it more to create/edit elements within archicad as opposed to just being a parameter control mechanism.
As with the grasshopper connection there would need to be a parameter that notifies the external software that it is required and what it is looking at. This would allow the external software to supply a specific UI for the selected object.
I struggle to understand how in 2019 we are still restricted to the tiny UI in the archicad selection setting dialog box. It is not conducive to supplying a good user experience especially given the complexities of some of the objects we are now using in our BIM models.
Thanks
Residential Designer based in Tauranga, NZ
Archicad v9+
VR enthusiast.
Always wants more!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-07 12:24 AM
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-07 11:37 AM
Ralph wrote:Thanks Ralph, good to know, just have to learn C++ now......ummmmm.....might be sometime!
Yes, that should work. Use this in conjunction with notifications from ARCHICAD of a selection change (and possibly editing if relevant).
Residential Designer based in Tauranga, NZ
Archicad v9+
VR enthusiast.
Always wants more!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-07 12:00 PM
But if your task isn't demanding, the new Python API might be an easier option.
Central Innovation