How to extend (shrink) a curve

Hi all,

how can a curve be extended in a negative direction.
I tried the code below but it works only for +20 not -20.

                    CrvEnd = rh.Geometry.CurveEnd.Both
                    CrvSt = rh.Geometry.CurveExtensionStyle.Line
                    CrvEx = rh.Geometry.Curve.Extend(j,CrvEnd,-20,CrvSt)

help is welcome.


For a “negative extension” you should use trim:
Passing the curve end and the length to trim it with.

Does this make sense?