Grasshopper

algorithmic modeling for Rhino

Hi everybody.

I'm trying to begin working on python to develop some custom nodes for a definition.

Now I'm just doing some exercises, and trying to learn python syntax

first of all here is my definition:

--------------------------------------------------------------

import rhinoscriptsyntax as rs
import ghpythonlib.components as ghcomp

context = y
offsetContext = []
crv = 0
for crv in context:
f = rs.OffsetCurve(crv,[1,0,0],distance)
offsetContext.append(f)

RDiff = ghcomp.RegionDifference(x,offsetContext)

a=RDiff

------------------------------------------------------------

the problem is that i've seen with some tests and panels that python gives me back:

x = curve

offsetContext = 5 IronPython.Runtime.Lists

these lists and the curve do not interact and the result of the RDiff is <null>

instead if I insert the IronPython.Runtime.List in a new python component, it unpack the lists and it gives me back the curves to work with.

I would like to do all the work inside a single component, is there a way to do that.

At the end some photos and the GH file

thank you

Views: 1790

Attachments:

Replies to This Discussion

Hi Phil

Check the attached file. I hope this helps

Attachments:

Thank you so much!!!

It was exactly my aim!!!

I didnt know anything about Coercecurve ()

this will help all my future steps... I've not found this component neither in Rhino Python Help

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service