LearnRevitAPI

Jun 10, 2024

pyRevit Linkify

💛pyRevit Linkify is a great feature that can create a linkable buttons to your elements and it can do 3 things:
- Select Elements
- Open Views
- Find Elements in the Active View (Zoom on it)

And it's very simple to use, let me show you.

💡Let's Learn: How To use pyRevit Linkify to Create Interactive Reports in Autodesk Revit.

You can get all the Code Snippets and Video in this blog post.

pyRevit Docs

As I've mentioned Linkify is very simple to use. But let's have a look at the documentation to find an example and understand how to use it.

There are 2 places we can look:

  1. pyRevit Dev Docs - Effective Outputs

  2. ReadTheDocs - pyRevit Linkify

The first link has a simple example where you will understand that you need to import script, get output, and then create linkify.

The second link will show you the doc string of this functions, and you will also notice that you have a second optional argument - title, to control what is written inside the button.

👇 Here is a screenshot of what's important:

💡 Make sure you import script and get_output to use next snippets!

Example 1  - Linkify Single Element

Here is an example to create Linkify for a single element. 

We will grab all walls in a view and then create linkify button for each wall. 

Also notice that I've provided wall.Name as the second argument, and that will be the title of our linkify button.

Example 2 - Linkify Multiple Elements

We can also provide a list of Element Ids if we want to create a linkable button for many elements at once.

⚠️pyRevit Linkify has a limitation of 100-150 Elements.

Example 4 - Linkify Views

You will also notice that you can linkify views. And by clicking on suck a linkify button it will open that specific view.

It's great if you want to quickly create a list of views and easily jump between them. This is especially useful if you work on a large project and you have hundreds of views, and sometimes it gets tedious to open the right ones for the day.

So here is a simple sample:

Bonus Example: Analyze Warnings Table

You've seen various example of using Linkify, but probably it wasn't that impressive. Now I want to show you a simple tool that can be extremely useful when you work with Revit Warnings.

This example will:
1. Get all warnings in the project,
2. Find elements related to these warnings
3. Find out who was the last person to modify them.
4. Print out the table that will have
- Warning Description
- Username of LastChangedBy
- Linkable Button to select and find these elements

💪 And that's how you create interactive reports with pyRevit Linkify. You can grab all the code snippets here

Enjoyed Newsletter?

Leave a Testimonial Here.

⌨️ Happy Coding!
Erik Frits

Join Newsletter

📩 You will be added to Revit API Newsletter

Join Us!

which is already read by 6700+ people!