Annotations / Tagmanian Devil

I’m working on a tool to apply multiple annotation tags to certain types of structural support elements in the model. This could work by applying all of the tags to all of the members and then clearing the empty ones, or pre-hashing the list of members for each tag based on whether certain parameter values are present. (Not sure which might be faster?)

My main issue, though, is figuring out the most efficient way to apply the tags and have the annotations land in their default position along the lines representing the members without having to fool around with endpoint geometry to calculate a precise location and orientation for IndependentTag.Create.

It seems there should be a way to trigger something more along the lines of Tag All in View for multiple tags. Could this be done using the PostCommand Method? Or maybe it makes more sense to use Dynamo?

Suggestions appreciated!

Dont have a’n immediate solution for you, but I suppose you mean that you’re looking for some kind of way to to create tags at their ‘default’ locations correct?

The problem with using PostCommand is that the command will only be executed after your script has finished running. So I’m afraid you’re stuck with IndependantTag.Create as your only option.

But maybe it’s not that bad though.

Tag orientation is always left in the hand of the user, even with Tag All in View, it will default in horizontal orientation?

So the only problem is probably the endpoint of the tag.

There’s a few rules that revit’s tag by category follows (without leader)

  1. Floors > Center Of Floor
  2. Columns> Center of Column
  3. Line based Elemend (Beam, Wall) → Above center of line

You can (without much foolery) get a decent endpoint for those elements I believe.
Actually, you can probably get an even better result, becase I really dislike how tags without leaders on columns are always in the center.

Just saying, calculating the positions isn’t all that bad.

Here’s how to get the center of a slab for instance

bb = floor.get_BoundingBox(None)
floor_center = (bb.Max + bb.Min) * 0.5

And to get the center of a wall you can do the same as the example above , OR:

curve = wall.Location.Curve
wall_center = curve.Evaluate(0.5, Normalized = True)
# Need an offset on that elemnet?
tag_offset = view.UpDirection * wall_thickness

tag_pos = wall_center + tag_offset

This is considering we’re in a plan view ofcourse, and the wall/beam is running horizontally across the view. You’ll need to do some math on the tag offset, but even there you can get a decent solution with a dash of trigonometry.
Performance wise this is all quite trivial so no worries there.

Thanks for that. I’ve got it working well for tagging after placement for elements that just need a tag in the center, and with a little math I think we can get it working for elements that need tags placed at different intervals that vary based on the length of the structural support.