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: 

How can I load a local webpage in Revit using CefSharp?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ajimenezcu
274 Views, 2 Replies

How can I load a local webpage in Revit using CefSharp?

Hello, I'm trying to load a local webpage in a Revit command using CefSharp. The problem is that to load a complete directory with HTML, CSS, and JavaScript files, it seems that I need to change the CefSharp settings using the Cef.Initialize(settings) method, which Revit already automatically performs during its initialization. As a result, I'm unable to load my web content in a window within my command.

I've also tried using the LoadHtml function, but it doesn't load the styles and scripts of my webpage. Is there any way to load a local webpage using CefSharp in Revit 2023 within a form?

Attached are images of the code:

 

ajimenezcu_0-1686312988858.png

ajimenezcu_1-1686313047924.png

 

Labels (2)
2 REPLIES 2
Message 2 of 3
ricaun
in reply to: ajimenezcu

I never have a problem opening a local html using CefSharp.

 

If you use the full path of the file should work: C:\Users\webExample\index.html

 

There is no way to overwrite the Revit Cef.Initialize, if exist a way probably gonna break stuff that is used by Revit.

The good part is that your application does not need to initialize Cef and doesn't need to send any Cef dll in your application, like the RevitApi.dll.

 

I created a library/package with all the CefSharp references used in Revit.

 

The project some samples that I used to test like this View with a webpage: https://github.com/ricaun-io/ricaun.Revit.CefSharp/blob/master/ricaun.Revit.CefSharp/Revit/Views/Web...

 

 

 

 

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 3 of 3
ajimenezcu
in reply to: ricaun

Thank you, is my fault.
I thought that it was necesary to use LoadHtml method, but you can use Load with a local file.

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

Post to forums  

Rail Community


Autodesk Design & Make Report