[Frage] Embedding a browser window as an Allplan-Plugin?


Is it possible to embed a Webview/Browser-Window in my PythonParts Add-On?

Hilfreichste Antwort anzeigen Hilfreichste Antwort verbergen

Hi,

yes, you can do it. One way would be to use WPF technology for building the dialog window, which you will then handle with a .NET application. I am not an expert on WPF and .NET framework, but I am sure you will find plenty of tutorials out in the internet, how to do it.

When you are done, you have to compile your .NET application to a .dll and reference it using clr library. clr is a python package, that enables you to use any .NET assembly within your Python script. Python environment in Allplan already have this package included. We build a small example showing how you can do this. So here you'll find the python script, that reference a .NET assembly (a "PythonWPFConnection.dll" library, see line 20), and in this directory you'll find the .NET project of the example (.xaml files with the window layout and C# source code with the logic). The assembly is a simple window with three input fields. Your window will contain a web browser.

I hope that helps!

Best,
Bart

Hi,

yes, you can do it. One way would be to use WPF technology for building the dialog window, which you will then handle with a .NET application. I am not an expert on WPF and .NET framework, but I am sure you will find plenty of tutorials out in the internet, how to do it.

When you are done, you have to compile your .NET application to a .dll and reference it using clr library. clr is a python package, that enables you to use any .NET assembly within your Python script. Python environment in Allplan already have this package included. We build a small example showing how you can do this. So here you'll find the python script, that reference a .NET assembly (a "PythonWPFConnection.dll" library, see line 20), and in this directory you'll find the .NET project of the example (.xaml files with the window layout and C# source code with the logic). The assembly is a simple window with three input fields. Your window will contain a web browser.

I hope that helps!

Best,
Bart