<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to embed a webpage in a dockable window in Revit? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12780523#M5192</link>
    <description>&lt;P&gt;I don't think that is a dockable issue. Actually the &lt;STRONG&gt;WebBrowser&lt;/STRONG&gt; is really bad, does not support modern javascript.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inside Revit is easier to use the &lt;STRONG&gt;CefSharp&lt;/STRONG&gt;, you just need to add the reference in your project and don't need to send with your plugin, similar like the &lt;STRONG&gt;RevitAPI.dll&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a package with the Revit references with the &lt;STRONG&gt;CefSharp&lt;/STRONG&gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/ricaun-io/ricaun.Revit.CefSharp" target="_blank"&gt;https://github.com/ricaun-io/ricaun.Revit.CefSharp&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I did this sample last week:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/ricaun-io/RevitAddin.CefWebView.Example" target="_blank"&gt;https://github.com/ricaun-io/RevitAddin.CefWebView.Example&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is a simple Wpf with some custom local &lt;STRONG&gt;HTML&lt;/STRONG&gt; and some &lt;STRONG&gt;JavaScript&lt;/STRONG&gt; intercommunication, but you can use a webpage as well. &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2024 14:20:32 GMT</pubDate>
    <dc:creator>ricaun</dc:creator>
    <dc:date>2024-05-17T14:20:32Z</dc:date>
    <item>
      <title>How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12780237#M5191</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to embed a webpage&amp;nbsp; link as follows in my Revit Doackable window application/Command:&lt;/P&gt;&lt;P&gt;&lt;A href="https://momento360.com/e/u/1eb0c5b8c1a64ef5a946b8ed3d53982e?utm_campaign=embed&amp;amp;utm_source=other&amp;amp;heading=0&amp;amp;pitch=0&amp;amp;field-of-view=75&amp;amp;size=medium&amp;amp;display-plan=true" target="_blank"&gt;https://momento360.com/e/u/1eb0c5b8c1a64ef5a946b8ed3d53982e?utm_campaign=embed&amp;amp;utm_source=other&amp;amp;heading=0&amp;amp;pitch=0&amp;amp;field-of-view=75&amp;amp;size=medium&amp;amp;display-plan=true&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But I get a blank dockable window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to embed &lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt; works successfully, embedding google maps pops up a lot of script errors as such:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrahi_amir_0-1715947897937.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1363789i6840276F59E80092/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrahi_amir_0-1715947897937.png" alt="mizrahi_amir_0-1715947897937.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was following &lt;A href="https://twentytwo.space/2020/02/23/revit-addins-dockable-window/" target="_blank" rel="noopener"&gt;this&lt;/A&gt; tutorial for creating this dockable window.&lt;/P&gt;&lt;P&gt;Next, I will be following this advanced solution made by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4176855"&gt;@ricaun&lt;/a&gt;:&lt;BR /&gt;&lt;A href="https://github.com/ricaun-io/RevitAddin.Dockable.Example/tree/master" target="_blank"&gt;https://github.com/ricaun-io/RevitAddin.Dockable.Example/tree/master&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My viewer xaml file is as simple as that:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Page x:Class="RevitAddInsWPFSample.Viewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:RevitAddInsWPFSample"
             mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="280" Title="WPF Sample" Background="White"&amp;gt;
    &amp;lt;Border BorderBrush="LightGray" BorderThickness="1"&amp;gt;
        &amp;lt;Grid Background="White" Margin="5" &amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition Height="Auto"/&amp;gt;
                &amp;lt;RowDefinition Height="*"/&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;
            &amp;lt;WebBrowser Grid.Row="1" Name="webbrowser" Margin="5"/&amp;gt;
        &amp;lt;/Grid&amp;gt;
    &amp;lt;/Border&amp;gt;
&amp;lt;/Page&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While my .xaml.cs file contains:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    public partial class Viewer : Page, IDockablePaneProvider
    {
        // fields
        public ExternalCommandData eData = null;
        public Document doc = null;
        public UIDocument uidoc = null;

        // IDockablePaneProvider abstrat method
        public void SetupDockablePane(DockablePaneProviderData data)
        {
            // wpf object with pane's interface
            data.FrameworkElement = this as FrameworkElement;
            // initial state position
            data.InitialState = new DockablePaneState
            {
                DockPosition = DockPosition.Tabbed,
                TabBehind = DockablePanes.BuiltInDockablePanes.ProjectBrowser
            };

        }
        // constructor
        public Viewer()
        {
            InitializeComponent();
            webbrowser.Source = new Uri("https://momento360.com/e/u/1eb0c5b8c1a64ef5a946b8ed3d53982e?utm_campaign=embed&amp;amp;utm_source=other&amp;amp;heading=0&amp;amp;pitch=0&amp;amp;field-of-view=75&amp;amp;size=medium&amp;amp;display-plan=true");

        }
        // custom initiator
        public void CustomInitiator(ExternalCommandData e)
        {
            // ExternalCommandData and Doc
            eData = e;
            doc = e.Application.ActiveUIDocument.Document;
            uidoc = eData.Application.ActiveUIDocument;
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how can I sort this out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 12:32:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12780237#M5191</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-05-17T12:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12780523#M5192</link>
      <description>&lt;P&gt;I don't think that is a dockable issue. Actually the &lt;STRONG&gt;WebBrowser&lt;/STRONG&gt; is really bad, does not support modern javascript.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inside Revit is easier to use the &lt;STRONG&gt;CefSharp&lt;/STRONG&gt;, you just need to add the reference in your project and don't need to send with your plugin, similar like the &lt;STRONG&gt;RevitAPI.dll&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a package with the Revit references with the &lt;STRONG&gt;CefSharp&lt;/STRONG&gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/ricaun-io/ricaun.Revit.CefSharp" target="_blank"&gt;https://github.com/ricaun-io/ricaun.Revit.CefSharp&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I did this sample last week:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/ricaun-io/RevitAddin.CefWebView.Example" target="_blank"&gt;https://github.com/ricaun-io/RevitAddin.CefWebView.Example&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is a simple Wpf with some custom local &lt;STRONG&gt;HTML&lt;/STRONG&gt; and some &lt;STRONG&gt;JavaScript&lt;/STRONG&gt; intercommunication, but you can use a webpage as well. &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 14:20:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12780523#M5192</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2024-05-17T14:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12782135#M5193</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4176855"&gt;@ricaun&lt;/a&gt;, you're doing and sharing great stuff!!&lt;BR /&gt;I also followed your &lt;A href="https://www.youtube.com/watch?v=H_gPAHY2TNk" target="_blank" rel="noopener"&gt;video&lt;/A&gt; concerning cefsharp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT, I have a naïve question - after cloning your CefWebView project from &lt;A href="https://github.com/ricaun-io/RevitAddin.CefWebView.Example" target="_blank" rel="noopener"&gt;here&lt;/A&gt;, how do I install and run it in Revit? After building your code I have no .addin file besides the dll file. Thus the command does not get loaded into Revit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please explain what am I doing wrong?&amp;nbsp; How can I run your code successfully?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2024 12:52:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12782135#M5193</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-05-18T12:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12784705#M5194</link>
      <description>&lt;P&gt;For development and load the plugin I use my plugin &lt;A href="https://ricaun.com/AppLoader/" target="_blank" rel="noopener"&gt;AppLoader&lt;/A&gt;, so I don't need to create/copy the .addin file to the Revit folder. The AppLoader does the job to load/unload the .dll with Revit open, so I don't waste time waiting Revit to open and close every time I need to test Revit API code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The .addin is created when you run the build automation to create the bundle folder and the installation for the plugin, the .addin and PackageContent.xml is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In all my solutions that contain the &lt;STRONG&gt;Build&lt;/STRONG&gt; project you can execute the &lt;STRONG&gt;build.cmd&lt;/STRONG&gt; to run the automation to build each Revit version available in the project, create the .addin for each version, organize in the bundle format with the PackageContent.xml file, and create a installation to basically copy the .bundle in the Autodesk &lt;STRONG&gt;ApplicationPlugins &lt;/STRONG&gt;folder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That automation runs in GitHub action as well to release the installation automatically depending of the dll version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a full workflow with the AppLoader: &lt;A href="https://youtu.be/O57jgsNegyo" target="_blank" rel="noopener"&gt;My First Revit Plugin - Part 1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 12:08:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12784705#M5194</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2024-05-20T12:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12786738#M5195</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4176855"&gt;@ricaun&lt;/a&gt;&amp;nbsp;- will take a look at that.&lt;BR /&gt;BTW, I have this xaml code with the following warning:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrahi_amir_0-1716279418780.png" style="width: 735px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1365044i52517E2FF75DCA2F/image-dimensions/735x168?v=v2" width="735" height="168" role="button" title="mizrahi_amir_0-1716279418780.png" alt="mizrahi_amir_0-1716279418780.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The 3 DLLs are present:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrahi_amir_1-1716279565910.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1365047iE2A63B2FF192E552/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrahi_amir_1-1716279565910.png" alt="mizrahi_amir_1-1716279565910.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But code still runs successfully. Why is that? I am afraid this warning might cause other issues that I am not aware of.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 08:39:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12786738#M5195</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-05-21T08:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12790465#M5196</link>
      <description>&lt;P&gt;I am trying to load a webpage upon clicking on an element.&lt;BR /&gt;This is how my Application initializes my selection event handler:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public Result OnStartup(UIControlledApplication application)
{
    // Create a new dockable pane id
    DockablePaneId paneId = new DockablePaneId(new Guid("9A795EF2-5A81-4300-95AD-FF339DA10DAF"));

    // Register dockable pane
    application.RegisterDockablePane(paneId, "My Browser Pane", new MyDockablePaneProvider());

    //Creating Tab and Ribbon
...
...
...
    // Initialize the selection handler and external event
    InitializeSelectionHandler(application);
    return Result.Succeeded;

}

private void InitializeSelectionHandler(UIControlledApplication application)
{
    // Create a new instance of the browser page
    MyImage browserPage = new MyImage();

    // Initialize the event handler with the browser page
    _handler = new ElementSelectionHandler(browserPage);
    _externalEvent = ExternalEvent.Create(_handler);

    // Register the event handler to the selection changed event
    application.SelectionChanged += Application_SelectionChanges;
}

private void Application_SelectionChanges(object sender, Autodesk.Revit.UI.Events.SelectionChangedEventArgs e)
{
        _externalEvent.Raise();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my ElementSelectionHandler class:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class ElementSelectionHandler : IExternalEventHandler
{
    private MyImage _browserPage;

    public ElementSelectionHandler(MyImage browserPage)
    {
        _browserPage = browserPage;
    }

    public void Execute(UIApplication app)
    {
        UIDocument uidoc = app.ActiveUIDocument;
        var selectedIds = uidoc.Selection.GetElementIds();

        if (selectedIds.Count &amp;gt; 0)
        {
            ElementId elementId = selectedIds.First();
            Element element = uidoc.Document.GetElement(elementId);

            string url ="https://www.mySecondLink.com";
            _browserPage.NavigateTo(url);
        }
    }

    public string GetName()
    {
        return "ElementSelectionHandler";
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is my Page class:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    public partial class MyImage : Page
    {
        // fields
        private bool _isBrowserInitialized;

        public MyImage()
        {
            InitializeComponent();
        }

        public void NavigateTo(string url)
        {
            Browser.Load(url);
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And its xaml file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Page x:Class="BuildEye.MyImage"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:BuildEye"
        xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
        mc:Ignorable="d"&amp;gt;

    &amp;lt;Grid&amp;gt;
        &amp;lt;cef:ChromiumWebBrowser x:Name="Browser" Address="https://www.myFirstLink.com" /&amp;gt;
    &amp;lt;/Grid&amp;gt;
&amp;lt;/Page&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And my DockablePaneProvider:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class MyDockablePaneProvider : IDockablePaneProvider
{
    public void SetupDockablePane(DockablePaneProviderData data)
    {
        MyImage page = new MyImage();
        data.FrameworkElement = page;
        data.InitialState = new DockablePaneState
        {
            DockPosition = DockPosition.Tabbed,
            TabBehind = DockablePanes.BuiltInDockablePanes.ProjectBrowser
        };
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running the above loads correctly the first link in my DocakblePane, but throws the following exception once I am selecting an element in Revit:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Exception thrown: 'System.Exception' in CefSharp.Wpf.dll&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Checking with ChatGPT, I modified my NavigateTo method as follows:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public void NavigateTo(string url)
{
    //Browser.Load(url);
    Dispatcher.Invoke(() =&amp;gt; Browser.Load(url), DispatcherPriority.Normal);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now I get this error:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;System.Exception: 'The browser has not been initialized. Load can only be called after the underlying CEF browser is initialized (CefLifeSpanHandler::OnAfterCreated).'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to get another solution from the Chat, no error but nothing happens and the second url doesn't get loaded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone instruct me how to figure this out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 15:24:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12790465#M5196</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-05-22T15:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12790685#M5197</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;Dispatcher&lt;/STRONG&gt; makes sense, but there is another problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your code you have two instance of the &lt;STRONG&gt;MyImage&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;One you created in the &lt;STRONG&gt;InitializeSelectionHandler&lt;/STRONG&gt; and another one used by Revit in the dockable in the &lt;STRONG&gt;MyDockablePaneProvider&lt;/STRONG&gt; class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to use only one, if you update the &lt;STRONG&gt;MyDockablePaneProvider&lt;/STRONG&gt; to receive a &lt;STRONG&gt;Page&lt;/STRONG&gt; would work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class MyDockablePaneProvider : IDockablePaneProvider
{
    private readonly Page page;
    public MyDockablePaneProvider(Page page)
    {
        this.page = page;
    }

    public void SetupDockablePane(DockablePaneProviderData data)
    {
        data.FrameworkElement = page;
        data.InitialState = new DockablePaneState
        {
            DockPosition = DockPosition.Tabbed,
            TabBehind = DockablePanes.BuiltInDockablePanes.ProjectBrowser
        };
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in the end something like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Create a new instance of the browser page
MyImage browserPage = new MyImage();

// Register dockable pane
application.RegisterDockablePane(paneId, "My Browser Pane", new MyDockablePaneProvider(browserPage));

// Initialize the event handler with the browser page
_handler = new ElementSelectionHandler(browserPage);
_externalEvent = ExternalEvent.Create(_handler);

...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 17:13:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12790685#M5197</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2024-05-22T17:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12841546#M5198</link>
      <description>&lt;P&gt;I am now trying to support also Revit versions prior to 2023, as the&amp;nbsp;SelectionChanged event was only introduced in Revit 2023 API.&lt;/P&gt;&lt;P&gt;I followed &lt;A href="https://forums.autodesk.com/t5/revit-api-forum/element-selection-changed-event-implementation-struggles/m-p/9237464/highlight/true#M43721" target="_blank" rel="noopener"&gt;this&lt;/A&gt; great answer by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2083518"&gt;@FAIR59&lt;/a&gt;&amp;nbsp;and all seems to work good except this error that I did not manage to resolve:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;System.Exception: 'The browser has not been initialized. Load can only be called after the underlying CEF browser is initialized (CefLifeSpanHandler::OnAfterCreated).'&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrachi_amir_0-1718451810761.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1376364iD7873A236A11B1FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrachi_amir_0-1718451810761.png" alt="mizrachi_amir_0-1718451810761.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my current workflow for versions prior to Revit 2023:&lt;/P&gt;&lt;P&gt;1. In my Application.cs added this code snippet under OnStartup():&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;#if !REVIT2023_OR_GREATER
            RibbonPanel m_ribbonPanel = application.CreateRibbonPanel(tabName, "ModifyPanel");
            string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;
            PushButtonData buttonData = new PushButtonData("cmd_Dummy",
                       string.Format("X"), thisAssemblyPath, "BuildEye.cmd_Dummy");
            buttonData.AvailabilityClassName = "BuildEye.CommandEnabler";
            m_ribbonPanel.AddItem(buttonData);

#endif

            rebarPanel.AddSeparator();
            // Initialize the selection handler and external event
            InitializeSelectionHandler(application);
            return Result.Succeeded;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        private void InitializeSelectionHandler(UIControlledApplication application)
        {
            // Create a new instance of the browser page
            MyImage browserPage = new MyImage();

            // Create a new dockable pane id
            DockablePaneId paneId = new DockablePaneId(new Guid("9A795EF2-5A81-4300-95AD-FF339DA10DAF"));

            // Register dockable pane
            application.RegisterDockablePane(paneId, "VRevit", new MyDockablePaneProvider(browserPage));


            //application.SelectionChanged += Application_SelectionChanges;
#if REVIT2023_OR_GREATER

            // Initialize the event handler with the browser page
            _handler = new ElementSelectionHandler(browserPage);
            _externalEvent = ExternalEvent.Create(_handler);

            // Register the event handler to the selection changed event
            application.SelectionChanged += Application_SelectionChanges;
#elif !REVIT2023_OR_GREATER
            application.ControlledApplication.ApplicationInitialized += ControlledApplication_ApplicationInitialized;
#endif
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        void ControlledApplication_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e)
        {
            adWin.RibbonControl ribbon = adWin.ComponentManager.Ribbon;
            adWin.RibbonTab BuildEyeTAB = null;
            adWin.RibbonPanel MyPanel = null;
            adWin.RibbonItem MyButton = null;
            // find MyPanel and MyButton
            foreach (var tab in ribbon.Tabs)
            {
                if (tab.Id == "BuildEye")
                {
                    BuildEyeTAB = tab;
                    foreach (var panel in tab.Panels)
                    {
                        if (panel.Source.Title == "ModifyPanel")
                        {
                            MyPanel = panel;
                            foreach (var item in panel.Source.Items)
                            {
                                if (item.Id == "CustomCtrl_%CustomCtrl_%BuildEye%ModifyPanel%cmd_Dummy")
                                {
                                    MyButton = item;
                                    break;
                                }
                            }
                        }
                    }
                    break;
                }
            }
            if (MyPanel != null &amp;amp;&amp;amp; MyButton != null &amp;amp;&amp;amp; BuildEyeTAB != null)
            {
                // find a "nice"position for the button
                int position = 0;
                foreach (var item in adWin.ComponentManager.QuickAccessToolBar.Items)
                {
                    if (string.IsNullOrWhiteSpace(item.Id)) continue;
                    position++;
                    if (item.Id == "ID_REVIT_FILE_PRINT") break;
                }
                // place button on QuickAccessToolBar
                if (position &amp;lt; adWin.ComponentManager.QuickAccessToolBar.Items.Count)
                {
                    adWin.ComponentManager.QuickAccessToolBar.InsertStandardItem(position, MyButton);
                }
                else adWin.ComponentManager.QuickAccessToolBar.AddStandardItem(MyButton);

                // remove button from MyPanel and hide tab if no panels 
                BuildEyeTAB.Panels.Remove(MyPanel);
                if (BuildEyeTAB.Panels.Count == 0) BuildEyeTAB.IsVisible = false;
            }

        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added CommandHandler class - tried to execute ElementSelectionHandler from here but getting the error described above:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class CommandEnabler : IExternalCommandAvailability
{
    private static ExternalEvent _externalEvent;
    private static ElementSelectionHandler _handler;
    MyImage browserPage = new MyImage();


    public bool IsCommandAvailable(UIApplication uiApp, CategorySet catSet)
    {
        // Raise the SelectionChangedEvent
        // Initialize the event handler with the browser page
        _handler = new ElementSelectionHandler(browserPage);
        _externalEvent = ExternalEvent.Create(_handler);
        _externalEvent.Raise();
        return false; // disable button
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added dummy command:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BuildEye.Commands
{
    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]

    public class cmd_Dummy : IExternalCommand
    {

        public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit,
     ref string message, ElementSet elements)
        {
            return Result.Succeeded;
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All other implementations remain as before, which are working great for Revit 2023 and above.&lt;/P&gt;&lt;P&gt;What am I doing wrong for older versions to work the same?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 12:15:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12841546#M5198</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-06-15T12:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12841600#M5199</link>
      <description>&lt;P&gt;Probably is a better to use a different approach to recreate the &lt;STRONG&gt;SelectChanged&lt;/STRONG&gt; event in Revit API for old versions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Using &lt;STRONG&gt;Idling&lt;/STRONG&gt; event is the most simple way to do that, and can look similar like the &lt;STRONG&gt;SelectChanged&lt;/STRONG&gt; introduced in 2023.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here an implementation for a class &lt;STRONG&gt;SelectionChangedWatcher&lt;/STRONG&gt; that use &lt;STRONG&gt;Idling&lt;/STRONG&gt; to check if the selection changed.&lt;/P&gt;&lt;P&gt;Is a little old and that's basically what I use in some projects.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2010/09/selection-watcher-using-idling-event.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2010/09/selection-watcher-using-idling-event.html&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your implementation with &lt;STRONG&gt;IExternalCommandAvailability &lt;/STRONG&gt;looks complicated and I don't believe is a good idea to use availability for things that is not related to availability of the command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 13:24:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12841600#M5199</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2024-06-15T13:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12841880#M5200</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4176855"&gt;@ricaun&lt;/a&gt;, for this reference.&lt;/P&gt;&lt;P&gt;As you mentioned, since this is an old code, I had to adjust it.&lt;/P&gt;&lt;P&gt;Under the SelectionChangedWatcher class, If I use this snippet as is:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;void OnIdling(object sender, IdlingEventArgs e )
  {
    Application app = sender as Application;

    UIApplication uiApplication
      = new UIApplication( app );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mizrachi_amir_0-1718477977298.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1376400i4134A1E65B815D69/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mizrachi_amir_0-1718477977298.png" alt="mizrachi_amir_0-1718477977298.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So I tried this approach:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application;

UIApplication uiApplication = new UIApplication(app);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then I get null for the 'app' variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 19:05:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12841880#M5200</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-06-15T19:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12842034#M5201</link>
      <description>&lt;P&gt;The sender in the &lt;STRONG&gt;Idling&lt;/STRONG&gt; is a &lt;STRONG&gt;UIApplication, &lt;/STRONG&gt;here is the reference for the events.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://help.autodesk.com/view/RVT/2022/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Advanced_Topics_Events_User_Inteface_Events_html" target="_blank"&gt;https://help.autodesk.com/view/RVT/2022/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Advanced_Topics_Events_User_Inteface_Events_html&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;void OnIdling(object sender, IdlingEventArgs e )
{
    UIApplication uiapp = sender as UIApplication;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 22:49:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12842034#M5201</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2024-06-15T22:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12842291#M5202</link>
      <description>&lt;P&gt;I am not sure I get the logic - Application OnStartup creates a new SelectionChangedWatcher instance and registers the OnSelectionChanged event:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;_selectionChangedWatcher = new SelectionChangedWatcher(application);

_selectionChangedWatcher.SelectionChanged += new EventHandler(OnSelectionChanged);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then,&amp;nbsp;SelectionChangedWatcher&amp;nbsp; constructor registers the OnIdling event:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public SelectionChangedWatcher(
  UIControlledApplication a)
{
    a.Idling += new EventHandler&amp;lt;IdlingEventArgs&amp;gt;(OnIdling);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the OnIdling, which is being called while application is still&amp;nbsp;initiating, tries to access the ActiveUIDocument:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;UIApplication uiApplication = sender as UIApplication;

ICollection&amp;lt;ElementId&amp;gt; selected = uiApplication.ActiveUIDocument.Selection.GetElementIds();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the ActiveUIDocument is still null at this stage.&lt;/P&gt;&lt;P&gt;What am I missing in the workflow?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 06:00:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12842291#M5202</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-06-16T06:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12842847#M5203</link>
      <description>&lt;P&gt;Yes that the idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;Idling&lt;/STRONG&gt; trigger even if you don't have a document open inside Revit. You need check if the &lt;STRONG&gt;ActiveUIDocument&lt;/STRONG&gt; is null, to basically ignore the &lt;STRONG&gt;Idling&lt;/STRONG&gt; code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 17:39:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12842847#M5203</guid>
      <dc:creator>ricaun</dc:creator>
      <dc:date>2024-06-16T17:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed a webpage in a dockable window in Revit?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12851140#M5204</link>
      <description>Thank you!!&lt;BR /&gt;That indeed solved my problem.</description>
      <pubDate>Thu, 20 Jun 2024 09:21:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-embed-a-webpage-in-a-dockable-window-in-revit/m-p/12851140#M5204</guid>
      <dc:creator>mizrachi_amir2</dc:creator>
      <dc:date>2024-06-20T09:21:42Z</dc:date>
    </item>
  </channel>
</rss>

