Revit API

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

rendering is active

142 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: 324
Registered: ‎03-05-2010
Message 2 of 4 (122 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 (119 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: 324
Registered: ‎03-05-2010
Message 4 of 4 (109 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Revit

Twitter

Facebook

Blogs

Youtube