Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Draw/Render over the ActiveView

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
rossen.hristov
1794 Views, 12 Replies

Draw/Render over the ActiveView

Hello,

 

Is there a way to draw an image over the ActiveView. I am trying to achieve the same look and feel as the one that you get when you go to View->Render and hit the Render button. The image will be produced by a third-party renderer but I can't find a way to draw this image over the current ActiveView.

 

Any ideas?

12 REPLIES 12
Message 2 of 13

Yes, sure.

 

Check out DirectContext3D:

 

http://thebuildingcoder.typepad.com/blog/2017/04/whats-new-in-the-revit-2018-api.html#3.26

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 13

Thank you. I will check it out right away.

Message 4 of 13

I looked around the DirectContext3D namespace, IDirectContext3DServer and DrawContext, but this is not what I am looking for.

 

Maybe I did not ask my question correctly.

 

I don't want to supply Revit with vertices and indices and let it draw them.

 

What I am looking for is to replace the image generated by Revit after the user clicks the "Render" button with my own image. Revit should not render anything -- V-Ray will do this job and will provide the rendered image. For example every other second.

 

I have attached a screenshot.

 

Thanks.

Message 5 of 13

I do not think Revit supports this out of the box.

 

On the other hand, I do think that other developers have achieved similar effects.

 

Maybe they use the Windows API to do so?



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 6 of 13

Thank you for the information.

 

Is there an example of implementing the DirectContext3D.IDirectContext3DServer interface and using DrawContext.FlushBuffer? I browsed Revit 2018 SDK Samples, but could not find one. Google does not return anything either.

Message 7 of 13

Dear Rossen,

 

I am checking with the development team for you.

 

Cheers,

 

Jeremy.



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 8 of 13
jeremytammik
in reply to: jeremytammik

Dear Rossen,

 

I am attaching the DuplicateGraphics SDK sample to this message.

 

It was not published with the Revit 2018 RTS SDK for technical reasons.

 

I hope it provides all you need to understand how to work with DirectContext3D.

 

Have fun!

 

Cheers,

 

Jeremy.



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 9 of 13

Thank you, Jeremy!

 

I will check it out.

Message 10 of 13

Thank you for your appreciation.

 

Please let us know how you end up making use of it.

 

Thank you!

 

Cheers,

 

jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 11 of 13

Hello,

 

I managed to run the sample and make a wall appear twice 😉 Now I need to find a clever and efficient way to draw an image bitmap pixel by pixel using DrawContenxt.FlushBuffe. The thing is, we want to render a bitmap image rendered by V-Ray over the Revit view and not create vector graphics.

 

Best Regards,

 

Rossen

Message 12 of 13

Published on The Building Coder now as well:

 

http://thebuildingcoder.typepad.com/blog/2017/05/revit-2017-and-2018-sdk-samples.html

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 13 of 13

How did you get it to run?  It doesn't seem to do anything for me.  I pick a wall and nothing happens.  Looking at the code, there appears to be a few methods that aren't hooked up.  When I tried adding one of them into the command run, I get an error in Revit.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community