Help with event triggered program

Help with event triggered program

james.levieux
Advocate Advocate
320 Views
2 Replies
Message 1 of 3

Help with event triggered program

james.levieux
Advocate
Advocate

Hi All,

 

I haven't done much event triggered programming in Revit so I'm hoping I can get some direction from y'all.

 

I want an alert to display when the user applies paint to a face in the model (or in the family editor), and I'll need info on the object that is being painted for the alert info. This is the problem I'm trying to solve:

https://forums.autodesk.com/t5/revit-ideas/warning-when-painting-geometry-that-has-no-base-material-...

 

My plan was to use a simple element modified event, find out if an object was modified, and if the paint was modified,  then do some checking to craft may alert.  To do this it seems like I'll need to register an element modified event each time a project or family is opened, so I'd do that with a DocumentOpened event. So I'm guessing I'd do that in the Application.cs code where the ribbon is defined?

 

I don't even know if the event response will give me enough information to determine if a material was applied so I feel like I'm groping in the dark.  Some experienced advice would be most appreciated.

 

Regards,

James

 

0 Likes
321 Views
2 Replies
Replies (2)
Message 2 of 3

MarryTookMyCoffe
Collaborator
Collaborator

Hmm, so you what to have this info on opening of document, so it is only for checking document that you get from others if it is valid. You can do it and FilteredElementColector will get you almost everything you what, But you will need a separate method fro family document and project document to search fro this material parameter type.
And if you what to check familie that you load into project you will need some more work.
You don't have to define events in IExternalApplication, you can still do it with button to make this on and off.
My suggestion is to start with revit lookup and see what exactly you are looking for.
It don't seems to be hard so even a beginner should be able to do it in like a week, just with a lots of try and error.
Oh and Ad in Manager for quick load IExternalCommand will be helpfull for you(you can get it from developer kit)

-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug
0 Likes
Message 3 of 3

Niko_Davydov
Advocate
Advocate

hi @james.levieux ,

You might find this topic helpful: Help | Database Events | Autodesk

best regards,
Nikolai Davydov

 

0 Likes