i am making an api that allows me to generate a rendering list and then let all the views present in the list render overnight..
i successfully made the list, and i am starting the rendering of the first image. what i dont know is when the rendering finishes, in order to start the next one.
is there a way to know what the program is doing or if the rendering is finished?
When Revit is free to accept user interaction, it triggers the Idling event. You can subscribe the Idling event to see if Revit finishes the rendering task.
i figured out meanwhile that i have to work with the Idling event. im reading everywhere but i feel somewhat dumb by not understanding what i have to do. i dont understand WHEN the idling event is triggered, how to detect it, how to use it, etc. all examples (full ones i mean) i have found are for c# and there are no examples for vb.net. what i would like to do is having a code executed every 3 seconds. Jeremy Tammik told me that i need the idling event or external event for that but i have no idea on how to access it and no idea on how to use it to time my code to 3 seconds...
Answer to your question.
>>> WHEN the idling event is triggered,
This event is raised when it is safe for the API application to access the active document between user interactions. The event is raised only when the Revit UI is in a state where the user could successfully click on an API command button
>>>how to detect it, how to use it, etc.
You need to create event handler for the Idling event, and subscribe the Idling event.
Revit event is compatible with .NET event. Please refer to the .NET event.
In the Revit SDK, there are samples showing how to use Idling event.
ModelessForm_IdlingEvent sample in the ModelessDialog subfolder.
MultithreadedCalculation sample in the AnalysisVisualizationFramework folder.
There are many code converter to convert C# to VB.NET. They can be easily found by search engine with the key word: C# VB convert.
With regard to 3 second interval, you can use a variable to calculate the time elapsed in the Idling event handler, when it is equal or over 3 seconds, implement what you want to do.
Access a broad range of knowledge to help get the most out of your products and services.