Relationship center of rotation Getlocation?

hi, I thought that the location point was center of rotation (obviously wrong considering the example)

Do you think it comes from family or bad certainty on my part?

thanks in advance

edit: Here are the 2 families:
ALPHI_PP_R.rfa (804 KB)
ALPHI_ST.rfa (844 KB)

Sincerely
christian.stan

I found a workaround with ElementTransformUtils class and Rotate Element method


RevitBoilerplate code +

elt=UnwrapElement(IN[0])
ang=IN[1]
loc=elt.Location.Point
Line_axis=Line.CreateBound(loc,XYZ(loc.X,loc.Y,1))

TransactionManager.Instance.EnsureInTransaction(doc)
ElementTransformUtils.RotateElement(doc,elt.Id,Line_axis,math.pi*ang/180)
TransactionManager.Instance.TransactionTaskDone()

OUT = elt

Looks like FamilyInstance.SetRotation uses a boundingbox
(If any of you can confirm this, thank you)
Sincerely
christian.stan

1 Like

Hi,
I have a curious thing that happens, it may come from my def which is not good
I do not know.



a missing beam yet 28 elts

#######OK NOW YOU CAN CODE########
elt=UnwrapElement(IN[0])
ang=IN[1]
def r_cent_l(i,a):
    loc=i.Location.Point
    Line_axis=Line.CreateBound(loc,XYZ(loc.X,loc.Y,1))
    TransactionManager.Instance.EnsureInTransaction(doc)
    ElementTransformUtils.RotateElement(doc,i.Id,Line_axis,math.pi*a/180)
    TransactionManager.Instance.TransactionTaskDone()


z=[r_cent_l(e,ang) for e in elt]
OUT = z

By placing an end transaction node between Family instance and IN[0] of the python node
I have everything but I have jerky things (see gif)
question 5 novembre

I would look at an error in my python function
thanks in advance
best regards christian.stan