lisa-marie mueller

lisa-marie mueller

bullet pont

place material tag link

November 20, 2020

paper airplanes and falling sheet of paper with title - in green Happy Friday! I took a break last week because my husband and I took a road trip for a few days. It was great to get a break and relax. We had the chance to do some hiking in Zion which was beautiful! We even got some snow. Today, we’re back with the last post of the series. This will be the last plug-in for the year but I have some great content for the rest of the year including another guest post about exporting OBJ from Revit and some Dynamo scripts.

material tags and limitations

Our final step is placing our material tag. To do this, we want to place an IndependentTag using the Create method. When we test our plug-in, though, there is one issue. The tags are hosted correctly but show a ‘?’ in place of the correct tag text. It isn’t until you manually nudge them that they show the correct tag information. I have done extensive research on the issue and it seems to be a bug that people are aware of. Some people have posted about various work-arounds but none of them worked for me. The most promising seems to be the one posted by Leo on the Autodesk forums in August he writes:

“I'm not sure if this issue has been officially solved but I also encountered this problem a few days ago and finally found a workaround.

I tried to create a material tag with leader with Revit API but the tagtext was always a question mark and none of the solutions that I could find from the Internet ever worked. You have to manually click on the tag or move it a little bit to activate it to show the right tagtext but you couldn't activate it with codes which is quite frustrating. But after some more experiment I happen to find a workaround which is quite simple:

Always set bool addLeader to false when you use IndependentTag.Create() and then set tag.HasLeader  to true and LeaderEndCondition to Free, then you can place the LeaderEnd, LeaderElbow and  TagHeadPosition wherever you want and the tagtext still shows correctly.”

He had also tested some of the previously discussed work-arounds and had no luck with those either. I tried the steps Leo outlined but could not get them to work for me in Revit 2019. I will try again when I upgrade to 2021, but maybe it will work for you. Having to nudge the tags is unfortunate, but not a deal breaker as this would still save significant time versus having to manually place all the tags so I will continue to keep an eye out for options in the future.


And that wraps up our material tagging plug-in. You can take a look at all the code on GitHub as well as download the compiled DLL to try. Next week, Andreas Brake will guest author a post about exporting families from Revit to an OBJ file.


If you want to learn to code and don’t know where to start check out my posts about Steps to Learn to Code [for architects and designers] Part 1 and Part 2.

Revit API Docs

bullet pont

recommended next