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:
Solved! Go to Solution.
Solved by ricaun. Go to Solution.
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...
Can't find what you're looking for? Ask the community or share your knowledge.