Python help

Hi guys.
Where is problem ??

Hi,

There’s really no need for lines 2 and 3, since you’re already funnelling in the line and circle(s)!
Just make sure that you set the Type hint for both inputs to ghDoc Object when Geometry (rhinoscriptsyntax). Additionally, either set the circle input to List Input or pass in [ci], because rs.ExtendCurve() expects a list of boundary object ids, not a single one.

a = rs.ExtendCurve(li, 0, 1, [ci])
1 Like

It works. Thank you budy .

1 Like

Hey budy. I need your advice again. Its similiar function, but another mistake.
What is wrong ? My input 3 mm line. I need to extend curves, but how ?
Thank you for your time :slight_smile:

Have you changed the type hint of the line input? It should be set to ghDoc Object when Geometry (rhinoscriptsyntax)!

Yes , i try it.vedeni_vrtaku.gh (3.6 KB)

Doesn’t seem like it! :wink:

Since you’re programming with rhinoscriptsyntax, the geometry inputs should be ghDoc Object when Geometry (rhinoscriptsyntax). This way a GUID is passed in, instead of a geometry object. Geometry objects are to be used with RhinoCommon.

rs.GetObject() and rs.GetReal() can only be used in Rhino, not Grasshopper!
In Grasshopper, you use the inputs to provide geometry and other values to the script!!

Here’s the revised script:

import rhinoscriptsyntax as rs

if line:
    if not length:
        length = 0.0
    extcrv = rs.ExtendCurveLength(line, 2, 2, length)

vedeni_vrtaku_2.gh (2.5 KB)

2 Likes

You are best. Im trying to create my grasshopper definition to Python code. Im using code for hand surgery. You save a life to someone …

Does somebody get his/her fingers extended? :wink:

Its for Ulna and Radius shortening and repositioning bones.

3 Likes