Grasshopper

algorithmic modeling for Rhino

Hi all, I know it might seem silly but I have this really annoying problem with filletting two curves with python in rhino.

Since I have to perform this operation many times in a script, I really need to make the script perform the command for me. The problem is that the rhinoscriptsintax command doesn't look to be working. Even the code from the example when I substitute the lines with selected curves:

import rhinoscriptsyntax as rs


curve0 = rs.GetObject("curve 0",4)

curve1 = rs.GetObject("curve 1",4)

rs.AddFilletCurve( curve0, curve1 )

The error give is :

Message: Unable to add curve to document

Traceback:
line 215, in AddFilletCurve, "C:\Users\Vincenzo\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\curve.py"
line 8, in <module>, "C:\Users\Vincenzo\AppData\Local\Temp\TempScript.py"

And this even for two simple curves created in the document. It only works if the two curves are actually touching one another with one end, but this is not the situation I am into.

So if this command cannot work with two separate curves (can it?) what I thought was to use a rhino.command in order to get the _Fillet command out to rhino. But I couldn't find a way to select the two curves not manually but through the script:

rs.Command("_Fillet")

rs.SelectObject(curve0)

rs.SelectObject(curve1)

doesn't work because the rs.select runs only after the previous one has been processed completely.

Of course I cannot select manually all the curves which are generated by the script, do you have any suggestion?

Thank you a lot in advance

Vincenzo

Views: 1706

About

Translate

Search

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service