Multi Reference Annotation

Hi there,

i have a Python script that uses the multi reference annotation command but only for vertical rebars in a section view and i need it for horizontal and diagonal rebar sets in section views and all rebars in floor plans as well.

I don’t really get how the XYZ method works for a vertical rebar distribution like this one:

I also found a python script on github that includes all of that but i am overwhelmed by the size of the script:

I tried it out but i get a warning and it’s not working:

Can somebody please help.

The files are uploaded here:

What I can understand from all of this is that the script can’t find any views in the first input. Can you check if your view get’s collected correctly as a view element in Dynamo?

Hey @d.kuurman,

thanks for the help.

Something is going wrong in line 611

Try replacing line 609 to asms = view (thus removing the filtredelementcollector)
The elementcollector tries to collect elements in the view but since you’re inputting a view it can’t find the view… I hope you understand what I mean by that :sweat_smile:

You can comment out lines in a python script by using a #. The line then doesn’t get read by the python interpreter.

The link below should point to the Revit API docs and then to the FilteredElementcollector class. This should explain a little bit of what that it.

Hope this helps!

Yes i know what the filteredelementcollector is doing, thanks!
Did i do it right? I think it need the view Id, anyways without the .Id i get the same warning

What does subscriptable mean?

Thank you so much @d.kuurman

Don’t pin me down on this explaination, but what it means is that you’re trying to call a property or index on an object which doesn’t have those kind of options. For a bit more indepth explaination check the link below.

What’s going wrong here is that you now try to get the index of the view in line 612 (asms[0]) You can’t do this because you’re not accessing a list objecttype. Also, since you now get the ID in line 611 you can’t get the ID in line 612 again because you’re effectively telling python to get the ID of an ElementId objecttype.

To solve this, either comment out line 612 and replace every instance of “ids” with “asms” or set the variable ids to asms (ids = asms)

If you’re having a problem with python try googling it outside of any Dynamo issue. Python is a widely used scripting language with a lot of documentation and users outside of the Dynamo community. I also highly recommend learning basics like this (if you aren’t already) if you have to use python more often in your Dynamo workflows. I especially recommend learning python if you use scripts you haven’t written yourself since it’s key to understand and customize a script to your needs.
Questions are ofcourse always welcome! :slightly_smiling_face:

Hope this solves the problems you’re having and goodluck!