Python - Multi-Rebar Annotation

Hey everyone,

i am trying to write a Python code to create Multi-Rebar Annotations. There is probably more mistakes in the script but why does not have the rebar object a ‘MultiReferenceAnnotation’ attribute?
image

That’s the method i am using: https://www.revitapidocs.com/2020/b3646880-ef76-d0d4-68d9-2c976163c340.htm

The snapshot is a bit blurry but from what I understand, you are trying to apply the method directly on Rebar element(s). MultiReferenceAnnotation is a class of objects and not a method. Per the link you included, you have to create annotation like this:

MultiReferenceAnnotation.Create(doc, ownerview, MultiReferenceAnnotationOptions)

that MultiReferenceAnnotationOptions will handle the elements (rebars in your case).
Also check out this discussion:

Thanks @habdirad,

i try to do use the method from the example. My first problem is: how do i get the MultiReferenceAnnotationType (that’s what the BuildingCoder also did)? I got the ID of the Type through the lookup tool. But i don’t know how to get the element…

.rvt and .dyn files:
https://uibkacat-my.sharepoint.com/:f:/g/personal/laurin_ernst_student_uibk_ac_at/Ei47wLYqV01CtlpdWNGINDEBOVMcsSZCD1L0QY2c5IPIGg?e=OXWxCe

Thanks for your help!