import rhinoscriptsyntax as rs
import ghpythonlib.components as ghcomp
for crv in curves:
#pts = rs.CurveEditPoints(crv)
pts = ghcomp.ControlPoints(crv)[0]
for pt in pts:
param = ghcomp.MeshClosestPoint(pt,mesh_o)[2]
pt_on_flat = ghcomp.MeshEval(mesh_f,param)
The error I get is this: AttributeError: ‘Python3Component’ object has no attribute ‘AddMessageForWarnings’
param_on_org gives an ok result like:
0[0.000;0.500;0.500;0.000]
“mesh_o” and “mesh_f” is declared as meshes on the component
“curves” are declared as curves on the component.
I don’t use ghpythonlib.components like this, so I’ve not seen this error until now:
Traceback (most recent call last):
File "rhinocode:///grasshopper/1/65905af3-8a55-4e39-9243-db9a35ddcd28/f045cc49-f925-4319-b898-0b3612458f2b", line 9, in <module>
File "...\.rhinocode\py39-rh8\site-rhinoghpython\ghpythonlib\components.py", line 171, in component_function
do_this = sc.doc.Component.AddMessageForWarnings
AttributeError: 'Python3Component' object has no attribute 'AddMessageForWarnings'
Similar error in an IronPython 2 component. But despite the warnings, does it work in a GHPython one?:
Have you tried placing and connecting the actual Grasshopper components? It’s often faster as it skips the Python automagick, Pythonnet and then Python, and then going all the way back again.
Node in Code looked amazing, but unfortunately I had problems too (just with the colour Gradient component), and never persisted with it.
Yes, that was my first solution.
But it is placed in a very long chain of commands and will handle around 40-100 meshes at a time.
some meshes have many curves, some have none.
And this made it hard to keep the curves to the correct meshes even if they are grafted.
Thats why I thought of creating the points and move them to the other mesh in one component instead even if it might even take more time to calculate.