Please log in to write a message.
-
4. Hanno (Dec 21, 2009 09.08):
Hi,
thanks for the code, that's indeed the better solution. Didn't know these objectGrip-methods exist (never needed them so far :-)
Regards
Hanno
-
3. M.Kuhn (Dec 21, 2009 08.45):
Hi Hanno,
thx for your answer, but i've solved it another way. I first tried the same as you, creating a new curve, but that way i created my self some serious problems after the "movement" so i decided i must move the curve, not draw a new one. Here is my code, just in case anybody else has the same problem:
Rhino.EnableObjectGrips(strTempCurve) 'grips are activated
Rhino.SelectObjectGrip strTempCurve, 0 'grip "0" is default selected
GripLocation = Rhino.ObjectGripLocation(strTempCurve, 0) 'get grip coordinates
bolErg = Rhino.PointCompare(GripLocation,ArrTempItemSP) 'in that case i wanna move the startpoint so i have to compare the grip coordinates and the startpoint coordinates of the chosen line to know wich (grip)point is selected, cuz i dont know if 0 is the start- or the endpoint of the line
If bolerg = True Then Rhino.ObjectGripLocation strTempCurve, 0, ArrActiveItemSP
Else Rhino.ObjectGripLocation strTempCurve, 1, ArrActiveItemSP 'here i move the point from its actual position to its new position
End If
Rhino.EnableObjectGrips strTempCurve , False 'deactivate grips
.........
.........
Hope i can help anybody alse with this pice of code...
-
2. Hanno (Dec 19, 2009 13.32):
Hi,
if you still need an answer:
rhino.curvestartpoint returns the coordinates of the point, not some kind of reference to the actual curve start, so you can only use it to read the point coordinates.
If you want to move the start point on the existing curve, you can use TrimCurve or ExtendCurve. If you want to move it somewhere else, you will need to create a new curve (you could use CurvePoints to get the control points and use these for your new curve).
Hope that helps, good luck learning RhinoScript!
Hanno
-
1. M.Kuhn (Dec 11, 2009 09.48):
Hi everybody,
i'm new to rhinoscipt and i'm trying to make my first script. After i was reading the "RhinoScript101" i thought i would be easy to make my own stuff, but what should i say..... its not! ;-) So hopefully anybody here can help me.
Is it possible to move the Start/Endpoint of a given curve (Line)!? I've tried several things but non of them worked...
StrTempCurve is the curve which point(s) should be moved
ArrTempItempSP is the current EndPoint of the curve
ArrActiveItemSP is the new location for the EndPoint
Rhino.move (Rhino.CurveStartPoint(strTempCurve),ArrTempItemSP,ArrActiveItemSP)
NOT WORKING
Set (Rhino.CurveStartPoint(strTempCurve) = ArrActiveItemSP
NOT WORKING
(Rhino.CurveStartPoint(strTempCurve) = ArrActiveItemSP
NOT WORKING
and now i have no idea what else i can do...!