Hi all,

I am trying to get PT to work in RhinoPython scripts, but have not had any success with this so far. There is an old thread from 2011 on this list:

http://v5.rhino3d.com/group/panelingtools/forum/topics/paneling-too...

that pretty much summarises my own experiences.  What is the state of the PT Python bindings at the moment?

Regards

Axel

Views: 242

Replies to This Discussion

Yes you can import PT library in Python for Rhino and Grasshopper. Here is a sample:

# sample script to show how to import PanelingTools and use with Python for Rhino

import math
import rhinoscriptsyntax as rs

#Add these 3 lines to import PanelingTools library
import clr
clr.AddReference("PanelingToolsDotNet")
import PanelingTools as pt

#divide input curve and assign result to output # Get the curve objects
object = rs.GetObject("Select curve", rs.filter.curve, True, True)
if rs.IsCurve(object):
  arrPoints = pt.Utility.DivideCurveByChordLength(rs.coercecurve(object), 1, True,)
  for pt in arrPoints:
    rs.AddPoint(pt)

Here is the same sample in Grasshopper

Ah, I see--the import syntax is different.  Many thanks for your help. 

Have a great weekend

Axel

RSS

Translate

© 2019   Created by McNeel Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service