How to Tag All Elements of Category in View without knowing their location point but they will not clash in view?

How to Tag All Elements of Category in View? Is there any way to hit that button with Revit API?


also is there any way to relocate the tag locations so they do not clash between each other in the view at scale in sheet? it is hard to know how they would look based on the drawing scale, text size and length in sheet/paper

Hi @RubenVivancos
Genius Loci has some nodes for tagging elements.
In your script you can filter by category to get to the elements to tag

thanks, I am aware of them but the only thing I do not like is that I need to specify the location point of all of the tags which I do not have idea, but I want to see tags attached to the elements in views and perhaps relocate them later once I know what annotative elements are in the views

simply take the midpoint of line based elements like Walls?

1 Like

I believe the in-product tool uses the midpoint of the object’s bounding box for most object types. Some exceptions I think are correct:

  • Spatial elements (rooms, areas, etc.) use the location point
  • Linear system families like walls and pipes use the mid-point of the curve.

in this case the location of the elements to tag are a point, so you suggest to get those points and place the tag type maybe some fixed distance above the location points for example?

1 Like

need to add the exception of sketch based elements as well which location are a list of curves

is there any way to relocate the tag locations so they do not clash between each other in the view? it is hard to know how they would look based on the drawing scale, text size and length in sheet/paper

I think there is a solution for that if you search the forum, but you said you wanted to relocate the tags?

Yes - and likely several other object type exceptions and zero visibility/zero geometry exceptions as well. For sketch based I would use the center of the bounding box generally.

@john_pierson has a great blog post showing the use of generative design to solve room tag placement here: https://dynamobim.org/optimizing-room-tag-placement-with-generative-design-dynashape-and-vasa/

You could expand on that for other object types as well for your use case.

1 Like

I saw this some time ago I believe it uses packages of DynaShape, VASA, Generative Design or more, what I believe is doing is taking all the elements geometry projection in 2D in a sheet with the drawing scale applied, and find a white space where there is no geometry within the viewcrop region on sheet.

If this needs to take all the elements geometry I think I can start to cry by waiting the script to run successfully, because getting elements geometry in dynamo is soooo slow.

maybe VASA package interpreted the view drawing as a projected image with colours so it can find where is the white space colour?

That’s not really what it is doing, but I guess close enough. The Vasa conversion shouldn’t take long for most views; more likely the delay is in Dynashape.

Keep in mind that you are trying to solve a very complicated problem which is geometric by nature. Many others have tried with AI tools being the most successful I have seen so far.

If speed is the only concern you could reduce calculation time by sticking to the Revit API and building an add-in, but that is a different forum. You might also get sufficient results using just VASA and a nearest neighbor exploration, removing the need for DynaShape. I imagine many views would calculate this way and you might even be able to remove generative design from the mix if you can live with a bit of action during QA (which should be budgeted for even with the most restrictive of toolsets).

1 Like