I am considering something. I want to send users’ information to Grasshopper and retrieve their keywords when they click the web button. After generating Rhino models in Grasshopper, I will upload the models to the web, as shown in the following figure.
The trouble now is, what should I do to let Grasshopper know that I clicked the button and updated it in real-time? I found a way to use WebSocket, but it failed in Rhino8.
Does anyone know of other real-time communication methods? Or give some tips, thank you very much!
Perhaps you would be interested in reading about rhino.compute?
Yes, I am researching Rhino.compute and working hard to find a solution
Hello, I have successfully imported the rhino3dm library into the project, but during testing, I found that the compute_rhino3d library cannot connect to my local server. Is there a problem with me?
Here is my code
import random
import rhino3dm
import compute_rhino3d.Util
import compute_rhino3d.Curve
compute_rhino3d.Util.authToken = ""
compute_rhino3d.Util.url = "http://localhost:6500/"
model = rhino3dm.File3dm()
curves = []
for i in range(20):
pt = rhino3dm.Point3d(random.uniform(-10, 10), random.uniform(-10, 10), 0)
# model.Objects.AddPoint(pt)
circle = rhino3dm.Circle(pt, random.uniform(1, 4))
# model.Objects.AddCircle(circle)
curve = circle.ToNurbsCurve()
curves.append(circle)
b_curves = compute_rhino3d.Curve.CreateBooleanUnion(curves)
for b in b_curves:
model.Objects.AddCurve(b)
model.Write('Test_bool_model.3dm', 8)
This is the error section
Traceback (most recent call last):
File "H:\Work\Niko_Project\custom_ai_web\RhinoWebDeveloper\test_read_rhino.py", line 20, in <module>
b_curves = compute_rhino3d.Curve.CreateBooleanUnion(curves)
File "E:\Anaconda3\envs\compute_rhino_3dm\lib\site-packages\compute_rhino3d\Curve.py", line 581, in CreateBooleanUnion
response = Util.ComputeFetch(url, args)
File "E:\Anaconda3\envs\compute_rhino_3dm\lib\site-packages\compute_rhino3d\Util.py", line 35, in ComputeFetch
return r.json()
File "E:\Anaconda3\envs\compute_rhino_3dm\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)