Revit API

Reply
Contributor
Frigotherm
Posts: 11
Registered: ‎03-16-2012
Message 1 of 4 (150 Views)

rendering is active

150 Views, 3 Replies
08-23-2012 11:21 PM

hi guys!

 

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?

 

thanks

 

frigo

ADN Support Specialist
Joe.Ye
Posts: 334
Registered: ‎03-05-2010
Message 2 of 4 (130 Views)

Re: rendering is active

08-28-2012 01:51 AM in reply to: Frigotherm

 

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.

 

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
Contributor
Frigotherm
Posts: 11
Registered: ‎03-16-2012
Message 3 of 4 (127 Views)

Re: rendering is active

08-28-2012 02:01 AM in reply to: Joe.Ye

Hi joe!

 

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...

 

thanks

 

Igor

ADN Support Specialist
Joe.Ye
Posts: 334
Registered: ‎03-05-2010
Message 4 of 4 (117 Views)

Re: rendering is active

08-29-2012 01:19 AM in reply to: Frigotherm

 

Hi Igor,

 

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.

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.