How to rotate object

i use:rs.RotateObject(obj,starpointCrv,corner) to rotated the object but not true.
I need it rotated round the curve with corner+= 90.
How get plane to rotate it.

Something like this perhaps:

import rhinoscriptsyntax as rs

rect=rs.GetObject("Select rectangle",4,preselect=True)
crv=rs.GetObject("Select curve")

insec=rs.CurveCurveIntersection(rect,crv)
if insec:
    r_pt=insec[0][1]
    crv_param=insec[0][5]
    plane=rs.CurvePerpFrame(crv,crv_param)
    rs.RotateObject(rect,r_pt,-90.0,plane.ZAxis,False)
2 Likes

Thank you


It don’t run with the circle curve input

Hmm, change

crv_param=insec[0][5] to crv_param=insec[0][7]

Dear Hevetosaur,
This is for rectangular if we want to rotate for other objects, for sample Leader.
can you help me
Thanks in advance

Kind Regards,
Ziustiar

Above was a special snippet of code for rotating a curve around another curve at a specific point. Is that what you are looking for, or just a general ‘rotate object’ script?

Hi HHelvetosaur
as described above, it’s just a different object. I need a rotated leader like the picture below.

OK, it’s still not the same thing as the original was based on the intersection of two curves. You have leader objects that may (or may not) touch the curve. And annotation objects with text respond differently to rotation than normal objects, depending on how you have the annotation style set up. So the results may be unpredictable. Try rotating your leaders 90° with the Gumball.

Thank you Bro…