Grasshopper

algorithmic modeling for Rhino

Hi Gurus!

I'm trying to write a vb.net script for contour command,
(http://en.wiki.mcneel.com/default.aspx/McNeel/SdkMakeRhinoContours)
but till now I got just, that it's impossible to convert types from "system.colection.generic.list[RMA.OpenNurbs.OnCurve]" into "RMA.OpenNurbs.IOnCurve".

Can somebody help me please?

Thanks in advance
Dima

Sub RunScript(ByVal geometry As List(Of OnCurve), ByVal directionCurve As OnLine, ByVal distance As Double)
' Create contour input
Dim contour As New MRhinoContourInput()
Dim g(0) As IOnCurve
g(0) = geometry

contour.m_geom = g
contour.m_AssignLayerBy = 0 '0 = CurrentLayer, 1 = InputObject
contour.m_bAddOutputToDocument = False
contour.m_basept = directionCurve.from
contour.m_bGroupByContourPlane = False
contour.m_bShowCount = False
contour.m_CountIncrement = 1
contour.m_endpt = directionCurve.To
contour.m_interval = distance
contour.m_JoinCurves = 1'0 = NoJoin, 1 = ByPolySurface, 2 = ByContourPlane
contour.m_limit_range = True

' Create arrays for contour output
Dim pline_array() As OnPolyline = Nothing
Dim curve_array() As OnCurve = Nothing
Dim points As ArrayOn3dPoint = Nothing
' Make the contours.
Dim rc As Boolean = RhUtil.MakeRhinoContours(contour, pline_array, curve_array, points)

A = points
End Sub

Views: 1266

Replies to This Discussion

I wrote this little script a while back, hope it helps. I was using it just for meshes, but you shouldn't need to change much to make it work on Breps
Attachments:
Thank you Daniel!
the mistake was that I put geometry as a list.

I was shure that trees would be in the plane section position, but I got just unsorted list of points :(
Any suggestions how it is possible to correct/reform it.

cheers!
Dima

has anyone edited this script to work w/ breps? I'm not sure how to do that.
here you go
Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service