SW addin and CEF browser

Programming and macros
vtal
Posts: 3
Joined: Fri Jul 01, 2022 8:10 am
Answers: 0
x 1

SW addin and CEF browser

Unread post by vtal »

Hello!

I'm currently working on a C# addin that needs to load a web page that can interact with solidworks.

I managed to load web pages using CefSharp but when using more advanced functions (javascript bindings) there is a conflict with the Cef process embedded into SW (swCefSubProc). The Cef process can only be loaded once and the one that loads is the basic SW version thus I'm missing some CefSharp functions. I tried running different versions of Cef in my addin (including the one used in SW) with no success.
The only solution I found to solve the conflicts is to remove the cef folder from the SW install directory (not a viable solution).

Using the built in version of Cef could be an option but I can't find any documentation on it.

Has anyone here managed to get a fully functional CefSharp implementation in their addin ? Or any other embedded web browser ?

Best regards,
User avatar
JSculley
Posts: 600
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 7
x 826

Re: SW addin and CEF browser

Unread post by JSculley »

Microsoft's WebView2 should do the trick.
vtal
Posts: 3
Joined: Fri Jul 01, 2022 8:10 am
Answers: 0
x 1

Re: SW addin and CEF browser

Unread post by vtal »

Thanks for the answer!
I tried WebView2 and it works well.
The only downgrade from CefSharp is the worse object passing from js to c#.
User avatar
AlexLachance
Posts: 2036
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2191
x 1892

Re: SW addin and CEF browser

Unread post by AlexLachance »

vtal wrote: Mon Jul 04, 2022 4:28 am Hello!

I'm currently working on a C# addin that needs to load a web page that can interact with solidworks.

I managed to load web pages using CefSharp but when using more advanced functions (javascript bindings) there is a conflict with the Cef process embedded into SW (swCefSubProc). The Cef process can only be loaded once and the one that loads is the basic SW version thus I'm missing some CefSharp functions. I tried running different versions of Cef in my addin (including the one used in SW) with no success.
The only solution I found to solve the conflicts is to remove the cef folder from the SW install directory (not a viable solution).

Using the built in version of Cef could be an option but I can't find any documentation on it.

Has anyone here managed to get a fully functional CefSharp implementation in their addin ? Or any other embedded web browser ?

Best regards,
I have a macro that creates a BOM, exports it as text and then sends it to the ERP, it opens a Chrome pop-up with all the information to validate and then push into the ERP. Could that have the answer inside it to your need..?
vtal
Posts: 3
Joined: Fri Jul 01, 2022 8:10 am
Answers: 0
x 1

Re: SW addin and CEF browser

Unread post by vtal »

Maybe, but I managed to implement what I wanted with Webview2, I can now call SW API functions from the browser (by using host objects).
Thanks anyway!
Post Reply