Hi Erik, I really enjoy the videos! The quality is just amazing 🎉 I have one more question: Which hook could be used in order to have the function done before the window of the family closed with the “x”(close option) just press the cross . I think it works only through selected close/save/save as buttons.
@ErikFrits4 ай бұрын
Thanks, happy to help! You would need to go through the list of Events and see what is more appropriate. There is definetely something like Close Family Document or Close Document. Maybe you would need to add a check what kind of document is being closed to ensure it only works for families. I hope you will find your answer!
@guillaumelallier60296 ай бұрын
Hi Erik, thanks for all of your work :). I would like to warn users when they are tring to delete elements. Ex. Levels or Slabs or such important model elements. I found the ID_BUTTON_DELETE that works fine with many element types, but if I want to prevent sheet deletion, it only works when the red X delete button is used but not the delete button on the keyboard or the right-clic delete sheet button. Also in the same idea, preventing drag (move) or drag-copy deon't respond to the ID_EDIT_MOVE or ID_EDIT_MOVE_COPY. anything I am missing ?
@ErikFrits6 ай бұрын
I haven't used these commands that you've mentioned, but sometimes there are many commands that sound the same, but have slightly different use. That might be the case. You might also want to check if you use event Before/After as it might affect the logic as well.
@green_heart0710 күн бұрын
Is there a way to suppress hooks to only run on specific document? For example, if document name contains "XYZ" only? I tried to add filter within the hook files but I noticed that even if I added an empty doc-changed.py inside hooks folder, my output message from other scripts would get taken over by hook output.
@ralphmartinez987110 ай бұрын
I am curious, can this be used to set up a “parameter pairing” function. I’ve been looking for ways to do something similar to Rushforth tools parameter linker but with a much friendlier user interface. I’m still very inexperienced but any tips/ pointers or even a video tutorial would be great.
@ErikFrits10 ай бұрын
Never heard of Rushforth tools, but I think you would need IUpdater. It's an interface that acts like a hook and it monitors Revit for any changes and allows to make additional changes in the same Transaction. e.g. You move window, and you can execute IUpdater that will write its coordinates to a certain parameter so it's always updated. I see some interest for it, so I will eventually make a video about it too ;)
@ralphmartinez987110 ай бұрын
i will definitely be on the lookout for this!@@ErikFrits
@KervinCalero7 ай бұрын
Awsome, similar to import CAD event I would like to do for changing the link settings (ie workset, pin/unpin, etc). Is that also possible? Thank you
@KervinCalero7 ай бұрын
Also can you please tell me if it would work for central - local network model vs ACC cloud model?
7 ай бұрын
What about the DocumentReloadingLatest event? I think i have correctly subscribed to it, but it never seems to trigger....
@ErikFrits7 ай бұрын
You might need to explore events triggers. The event you mentioned: This event is raised when Revit is just about to reload latest changes from a central model. I would recommend to start very simple and just make some print statement when it's triggered. If you can't get it to print, then either your event is not triggering, or you have an error in your event handler and therefore nothing happens. As I've mentioned errors happened during the events won't be shown to us, so we need to make sure our code is working good and we handle all the errors ourselves.
7 ай бұрын
@@ErikFrits Thanks for the reply! I tried and tried and couldn’t get that particular event to ever fire. However, I was able to use WorksharedOperationProgressChanged event. It has a property called “ReloadLatestFinished”. The event triggers a bunch of times during reload latest, but you can track the status using that property.
@ningzhou839710 ай бұрын
cool stuff! will be great if you can create another video for IUpdater in Python (instead of C#), not sure if pyRevit covered this specific topic?
@ErikFrits10 ай бұрын
Thanks. Yes, pyRevit also has a hook for IUpdater called doc-updater.py I will make a note about IUpdater.
@YuK-h6b9t10 ай бұрын
Wow. Amazing But I wondered - How can I block the “Edit Family” button in the same way? Couldn't find cmd-ID. Help(
@ErikFrits10 ай бұрын
Not sure about that one. There is a command called 'OpenFamily'. That might work, but you need to think how to determine if it was executed from correct place. I would check user selection with uidoc.Selection.GetElementIds() and see if an instance of the same family is selected. So you still can open it from the Project Browser, but not from double clicking on a family. Just giving you an idea of the top of my head. You would probably need to refine it or find an alternative Event ;) Happy Coding!
@brunoCarneiroDis4 ай бұрын
@@ErikFrits in my case is almost the same. Most of the things in Revit can be done more than 1 way. In my case i would like to avoid the user to insert families in a model. I have seen that i can block Load Family, Load Autodesk Family, Load as Group, Load into Project and Close but Load Into Project i did not find a cmd-ID
@andid950210 ай бұрын
how about to stop "drag and drop" ? ;)
@ErikFrits10 ай бұрын
Haven't seen events in Revit API for that, but I think there should be a way to stop it. I will look around later, maybe someone has a hint