visose,

Nice one again!  You're going to have to patent a name for this
method.  "RhinoScripting with VB.NET" doesn't really roll off the
tongue.

-taz

On Apr 27, 12:38 pm, visose <[email protected]> wrote:
> Another hack (which is probably even worse) is to use a vb.net script
> to bake the lines, call the 'seldup' command in rhino, delete the
> duplicates, reference the remaining lines to GH and delete the
> remaining lines. Here's is a modified version of the code i posted in
> the '3d voronoi' thread to achieve just this. Beware, this is very
> amateurish code:
>
>     Dim obj(x.count - 1) As IRhinoCurveObject
>     For i As Integer = 0 To x.count - 1
>       obj(i) = doc.AddCurveObject(x(i))
>     Next
>
>     doc.UnselectAll()
>     app.RunScript("!-_seldup -_delete")
>     doc.UnselectAll()
>     app.RunScript("!-_selcrv")
>
>     Dim go As New MRhinoGetObject()
>     go.EnablePreSelect(True)
>     go.EnablePostSelect(False)
>     go.GetObjects(0, 0)
>
>     Dim obj_list As New List(Of OnCurve)
>     For i As Integer = 0 To go.ObjectCount() - 1
>       Dim objref As IRhinoObjRef = go.Object(i)
>       Dim objb As oncurve = objref.Curve
>       obj_list.Add(objb)
>     Next i
>
>     For i As Integer = 0 To x.count - 1
>       doc.DeleteObject(New MRhinoObjRef(obj(i)), True, True)
>     Next
>
>     a = obj_list
>
> On Apr 27, 4:55 pm, oompa_l <[email protected]> wrote:
>
> > Hi Andrew
>
> > Yes, that worked perfectly. Thanks so much. I should say that I
> > understand what you were doing before a little better...in theory it
> > should have been working but I think there was a problem with
> > precision as you say. When I removed the level of operations just
> > before adding everything together I got much improved results, though
> > they still missed a couple of lines - probably due to a coincidence
> > between similar cumulative results being rounded to an
> > integer...anyways, the one you prepared did the trick. thanks again

Reply via email to