Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Python code - loft

$
0
0

Hi,

I’m trying to create a simple code that creates a loft between 2 selected curves but I keep getting the following error:

"Message: expected float, got Guid

Traceback:
line 2492, in EvaluateCurve, “C:\Users\rneto\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\curve.py”

Can someone tell me what’s wrong with my code? For the life of me I just can’t figure it out:

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
from Rhino.Geometry import *

curve01 = rs.GetObject("Select a closed curve", rs.filter.curve, True, False)
curve02 = rs.GetObject("Select a closed curve", rs.filter.curve, True, False)

closestPoints = rs.CurveClosestObject(curve01, curve02)
start = rs.EvaluateCurve(curve01, closestPoints[0])
end = rs.EvaluateCurve(curve02, closestPoints[1])

loft = Rhino.Geometry.Brep.CreateFromLoft([curve01, curve02], start, end, 3, True, 0)
if loft:
    for brep in loft:
        sc.doc.Objects.AddBrep(brep)
    sc.doc.Views.Redraw()

Thank you

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles