Revit API Events and pyRevit Hooks Explained (Say Goodbye to CAD Imports)

Опубликовано: 18 Март 2024
на канале: Erik Frits
2,026
64

📙 Get Free E-Book: Beginner's Guide to Revit API:
https://learnrevitapi.com/ebook

🎯 Interested in Learning Revit API in the fastest way possible?
Join Learn Revit API Course: https://learnrevitapi.com

--------------------------------------------------
🔗 Links from Video:

...

--------------------------------------------------
📝 Video Summary:

pyRevit Hooks, Revit API Events...
I've been getting many questions about them. So it's time to cover it on the channel!

There are 4 different types of Events
Data Base Events (under Application Class)
UI Events (under UIApplication Class)
Command Binding Events (monitor PostableCommands)
IUpdater (Monitor changes and add more)
💡 IUpdater is not technically an Event, but it behaves like one, so it's part of the club.

In this video, I will focus mainly on the Command Binding events, so we can pop-up a warning message, whenever a user clicks on the Import CAD. This will allow us to block users from Importing CAD and give them a warning message that they should you Link CAD instead. And to make it a bit more fun, we will also ask users for a password, so only a select few have this power.

--------------------------------------------------
🎬 Chapters:
0:00 pyRevit Hooks / Revit API Events
1:00 Event Types in Revit API
1:55 How to Subscribe to an Event?
2:15 Create pyRevit Hook
5:05 Extension Hooks Names
6:15 How to find Command Id?
8:00 Create command-before-exec[cmd-id]
8:55 Code for Event Handler
11:45 Testing
12:25 Remove Hook
12:45 Subscribe Manually to Revit API Event
15:00 Unsubscribe from an Event
15:30 More Events?

--------------------------------------------------
⌨️ Happy Coding!

Tags: #LearnRevitAPI #RevitAPI #pyrevit


Смотрите видео Revit API Events and pyRevit Hooks Explained (Say Goodbye to CAD Imports) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Erik Frits 18 Март 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,026 раз и оно понравилось 64 людям.