top of page

Automatic Legend Components

Hi everyone,


I'm excited to share with you a new feature of the pyM4B extension for Revit. This feature allows you to automatically create Revit legends for your drawings in a fast and easy way. Let me show you how it works.


The feature is called "Legend Component", and, starting from a selected legend component, it creates one component per Family Type* of the selected category.

* It collects only used Family Types.


But that's not all, because the main issue with the legend components in Revit is that, once placed, they can be tagged by material tags, but not dimensioned! 😡


How to dimension legend components?

Our tool, if a legend component of a compound object is selected, also places all the material tags and automatic dimensions ✨. This is something that Revit doesn't do by default, so it saves you a lot of time and hassle.


Good points

  • 🤓 Material tags equally spaced

  • 🤖 Dimensions are possible thanks to the presence of very small (and dimensionable) annotation lines placed automatically by the computer.


How to

To use the feature, you need to have the pyM4B extension installed in your Revit. Then, you need to (1) select a source legend component, (2) a TextNote with the name of the parameters you want to have in your legend written between { }, only and in case your legend component is a compound object (walls, floors ...), select the Material Tag Type to use.


The whole process is so quick that could have been recorded in a GIF!

automatic Revit Legend components and dimension

Alert!!

You might have noticed that some material tags somehow don't recognize their host, we couldn't give an explanation for it, but selecting them all and moving back and forward ⇄, permits the restoration of the host.


And that's it! You have created your legends in minutes, without having to manually draw or tag anything.


 

I hope you find this feature useful and helpful for your projects. If you have any feedback or suggestions, please let me know in the comments below.


Cheers!



355 views4 comments

Recent Posts

See All

4 comentários


ryzygeja
15 de nov. de 2023

Hi Giuseppe. I have been searching for this method a looong time. It works fine on floors, but I get an error when i try it on walls. Components.pushbutton\AutoLegend_script.py", line 53, in <module> AttributeError: 'FamilySymbol' object has no attribute 'Kind' Script Executor Traceback: System.MissingMemberException: 'FamilySymbol' object has no attribute 'Kind' at IronPython.Runtime.Binding.PythonGetMemberBinder.FastErrorGet`1.GetError(CallSite site, TSelfType target, CodeContext context) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at IronPython.Runtime.Binding.PythonGetMemberBinder.FastPropertyGet`1.GetProperty(CallSite site, TSelfType target, CodeContext context) at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)

Curtir
macro4bim
macro4bim
16 de nov. de 2023
Respondendo a

Hi ryzygeja,

Thanks for reaching out. This error might be due to the presence of Model-in-Place of Wall category in your project. During the definition of the function, I didn't take in consideration such possibility, but the code is now updated to avoid this kind of errors as well.

Please update the extension and let us know if you have any other questions.

Curtir

André Almeida
André Almeida
09 de nov. de 2023

Hi Giuseppe.


I´m getting an error while selecting the legend component (Revit 2021.1.9). Any idea?


IronPython Traceback: Traceback (most recent call last): File "C:\Users\AndreAlmeida\AppData\Roaming\pyRevit\Extensions\pyM4B.extension\pyM4B.tab\Create.panel\Legend Components.pushbutton\AutoLegend_script.py", line 28, in <module> AttributeError: 'Category' object has no attribute 'BuiltInCategory'


Curtir
macro4bim
macro4bim
10 de nov. de 2023
Respondendo a

Hi André,

Thanks for the complete explanation, this error is is expected as the attribute BuiltInCategory for the Category Class was introduced in the Revit version 2023.

I just edited the code to permit retro-compatibility, please try to reload the extension.

Curtir
bottom of page