Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Draw/Render over the ActiveView

rossen.hristov
Enthusiast

Draw/Render over the ActiveView

rossen.hristov
Enthusiast
Enthusiast

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?

0 Likes
Reply
Accepted solutions (1)
2,951 Views
12 Replies
Replies (12)

jeremytammik
Autodesk
Autodesk

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

rossen.hristov
Enthusiast
Enthusiast

Thank you. I will check it out right away.

0 Likes

rossen.hristov
Enthusiast
Enthusiast

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.

0 Likes

jeremytammik
Autodesk
Autodesk

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

0 Likes

rossen.hristov
Enthusiast
Enthusiast

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.

0 Likes

jeremytammik
Autodesk
Autodesk

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

0 Likes

jeremytammik
Autodesk
Autodesk
Accepted solution

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

rossen.hristov
Enthusiast
Enthusiast

Thank you, Jeremy!

 

I will check it out.

0 Likes

jeremytammik
Autodesk
Autodesk

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

0 Likes

rossen.hristov
Enthusiast
Enthusiast

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

0 Likes

jeremytammik
Autodesk
Autodesk

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

michael-coffey
Advocate
Advocate

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.

0 Likes