2024-04-22 01:13 AM - last edited on 2024-09-26 12:08 PM by Doreena Deng
As far as I understand, the Archicad-Grasshopper live connection add-in is communicating with Rhino over a TCP connection over port 19723, (by default). I'm curious if anyone knows any details of exactly what format the message is in. My guess is that the connection uses the Archicad JSON interface, and that the live connection add-on is specifically an add-on command to the JSON interface. Based on the documentation, the command message should look something like this:
{ "command": "API.ExecuteAddOnCommand", "parameters": { "addOnCommandId": { "commandNamespace": "MyAddOnCommandNamespace", "commandName": "MyAddOnCommandName" }, "addOnCommandParameters": { "myAddOnCommandParameter1": "X=?" } } }
Can someone from GS possibly share the details of how this live connection add-in is actually called, specifically the addOnCommandID, commandNamespace, commandName, and schema of the addOnCommandParameters object?
The reason I ask is that the connection's GH nodes, as good as they are, lack some fine-grained control over surfaces on morphs (you can only assign a building material for the whole thing), and I would like to see I can code my own version.
Solved! Go to Solution.
2024-04-22 04:01 AM
On the chance you haven't already done this, you might want to look at the C++ API Document example -- AddonCommand Test. The Addon accepts and sends Commands and values via a JSON database The AddOn uses a JSON schema to verify the data and will fail if not valid. Fortunately Graphisoft provides a rudimentary schema but if you deviate, you must add your own. This format is commonly used to implement Python scripts, but the concept is the same for the grasshopper python interface. The Python API conveniently wraps the JSON data format so that JSON commands do not need be used. In that case, Graphisoft will do it for you. In Grasshopper, you can use the Python format ( Iron Python ) or the JSON examples in the pypi documentation site.
2024-04-22 04:01 AM
On the chance you haven't already done this, you might want to look at the C++ API Document example -- AddonCommand Test. The Addon accepts and sends Commands and values via a JSON database The AddOn uses a JSON schema to verify the data and will fail if not valid. Fortunately Graphisoft provides a rudimentary schema but if you deviate, you must add your own. This format is commonly used to implement Python scripts, but the concept is the same for the grasshopper python interface. The Python API conveniently wraps the JSON data format so that JSON commands do not need be used. In that case, Graphisoft will do it for you. In Grasshopper, you can use the Python format ( Iron Python ) or the JSON examples in the pypi documentation site.