Hi Thomas,

the const problem you have is due to:

    Dim pline As IOnPolyline = pline_crv.m_pline
    Dim PL As OnPolyline = pline

pline is of type IOnPolyline, whereas PL is of type OnPolyline. The
"I" in front of IOnPolyline indicates that the data inside that
instance cannot be changed (it is constant, or 'const').
You cannot simply change an IOnPolyline into an OnPolyline because
that would mean you'd bypass the security.

Since you are not changing the polyline corners, you have no need for
a 'mutable' instance if of this curve, thus simply remove PL entirely,
and use pline instead.

--
David Rutten
Robert McNeel & Associates


On Oct 28, 4:23 pm, bildsoe <[EMAIL PROTECTED]> wrote:
> Hi David
>
> Thank you very much...
>
> I still get an error: "script exception: Attempted to call a non-const
> function with a const object"
>
> I tried looking at the reflect. Both at the polyline curves i output
> and at the ones i input and try to find the control points.
> The ones i output are onPolyline not onPolylineCurve is there a
> difference? The ones i input shows in reflect as OnCurve and constcast
> is in the list of methods.
>
> I uploaded the 
> ghx:http://grasshopper3d.googlegroups.com/web/thomas_tower_ver5.ghx
>
> Again thanks
>
> Thomas
>
> On Oct 28, 2:30 pm, David Rutten <[EMAIL PROTECTED]> wrote:
>
> > Hi Thomas,
>
> > due to the C++/.NET nature of the Rhino SDK, you cannot convert just
> > like that.
>
> > First, cast your generic OnCurve to an OnPolylineCurve (this only
> > works if the curve really is an OnPolylineCurve btw.):
> > Dim pline_crv As IOnPolylineCurve = OnPolylineCurve.constcast(x)
>
> > Then you can extract the polyline from this wrapper class:
> > Dim pline As IOnPolyline = pline_crv.m_pline
>
> > If you need more information about input types, use the reflect
> > function in your script and feed the result into a PostIt panel (like
> > you are doing now):
> > Reflect(x)
>
> > --
> > David Rutten
> > Robert McNeel & Associates.
>
> > On Oct 28, 3:06 pm, bildsoe <[EMAIL PROTECTED]> wrote:
>
> > >http://grasshopper3d.googlegroups.com/web/polyline_trouble.jpg
>
> > > This link shows my problem...
>
> > > On Oct 28, 12:37 pm, bildsoe <[EMAIL PROTECTED]> wrote:
>
> > > > Thanks for the quick replies.
>
> > > > I realise that propably i have another problem because i have one
> > > > script component outputting 20 Polyline Curves and then i wan't to
> > > > divide these at the control points and add frames at these points.
> > > > When i use the frames component in the menu (which add frames at
> > > > equally divided sections), it returns 320 frames instead of 20 lists
> > > > of x frames (x being number control points). Now the problem is, there
> > > > is no type hint for polyline curve and when i bring in as a onCurve
> > > > the count() does not work and if i try to convert it into a polyline
> > > > it just says "cannot convert... to polyline". Is there another way to
> > > > do this?
>
> > > > Thomas- Hide quoted text -
>
> > - Show quoted text -

Reply via email to