<?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: Windows form on same screen as revit in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790624#M22078</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;I don't know how can I get the (owner) Arg. from Revit API,&lt;BR /&gt;it's seems that it needs &lt;STRONG&gt;IWin32Window&amp;nbsp;&lt;/STRONG&gt;object but I don't know how to retrieve it&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 12:21:57 GMT</pubDate>
    <dc:creator>Omar_Amen</dc:creator>
    <dc:date>2021-11-30T12:21:57Z</dc:date>
    <item>
      <title>Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790356#M22076</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a plugin where a form appears if I click on my plugin button.&lt;/P&gt;&lt;P&gt;I work with a laptop and have two additional monitors.&lt;/P&gt;&lt;P&gt;the form always pop ups on my laptop screen, instead I want it to pop up on the screen where Revit is running.&lt;/P&gt;&lt;P&gt;How can I accomplish this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you guys can help me with this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 09:59:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790356#M22076</guid>
      <dc:creator>Gilles.Lagrilliere</dc:creator>
      <dc:date>2021-11-30T09:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790470#M22077</link>
      <description>&lt;P&gt;Set the parent as Revit window via it's handle&lt;/P&gt;&lt;P&gt;Form.Show(Owner) or&amp;nbsp;Form.ShowDialog(Owner)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then set Form.StartPosition to CenterParent.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 11:13:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790470#M22077</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-11-30T11:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790624#M22078</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;I don't know how can I get the (owner) Arg. from Revit API,&lt;BR /&gt;it's seems that it needs &lt;STRONG&gt;IWin32Window&amp;nbsp;&lt;/STRONG&gt;object but I don't know how to retrieve it&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 12:21:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790624#M22078</guid>
      <dc:creator>Omar_Amen</dc:creator>
      <dc:date>2021-11-30T12:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790628#M22079</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;check this link out:&amp;nbsp;&lt;A href="https://thebuildingcoder.typepad.com/blog/2010/06/revit-parent-window.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2010/06/revit-parent-window.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;this helped me to get&amp;nbsp;&lt;STRONG&gt;IWin32Window&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;object.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 12:26:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790628#M22079</guid>
      <dc:creator>Gilles.Lagrilliere</dc:creator>
      <dc:date>2021-11-30T12:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790640#M22080</link>
      <description>&lt;P&gt;Not used forms in a long while but I would probably try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; Public Function Obj_211130a(commandData As ExternalCommandData, ByRef message As String, elements As ElementSet) As Result

        Dim app = commandData.Application
        Dim uidoc = commandData.Application.ActiveUIDocument
        Dim IntDoc = uidoc.Document

        Dim F As New System.Windows.Forms.Form
        F.StartPosition = WF.FormStartPosition.CenterParent

        F.ShowDialog(New RvtWindow(app))

        Return Result.Succeeded
    End Function
    Public Class RvtWindow
        Implements Interop.IWin32Window

        Private IntHwnd As IntPtr
        Public Sub New(App As UIApplication)
            IntHwnd = App.MainWindowHandle
        End Sub

        Public ReadOnly Property Handle As IntPtr Implements IWin32Window.Handle
            Get
                Return IntHwnd
            End Get
        End Property
    End Class&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 12:30:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790640#M22080</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-11-30T12:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790655#M22081</link>
      <description>&lt;P&gt;thanks both worked&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 12:38:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790655#M22081</guid>
      <dc:creator>Omar_Amen</dc:creator>
      <dc:date>2021-11-30T12:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790710#M22082</link>
      <description>&lt;P&gt;Note that the post from 2010 os obsolete and has been superseded by:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two new properties in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Autodesk.Revit.UI&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;namespace provide access to the handle of the Revit main window:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;UIApplication.MainWindowHandle&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;UIControlledApplication.MainWindowHandle&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2018/11/revit-window-handle-and-parenting-an-add-in-form.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2018/11/revit-window-handle-and-parenting-an-add-in-form.html#3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 13:04:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790710#M22082</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-11-30T13:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790837#M22083</link>
      <description>&lt;P&gt;How do I make it work with the new properties?&lt;/P&gt;&lt;P&gt;I tried frm.ShowDialog(CommandData.Application.MainWindowHandle)&lt;/P&gt;&lt;P&gt;but that doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 13:54:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10790837#M22083</guid>
      <dc:creator>Gilles.Lagrilliere</dc:creator>
      <dc:date>2021-11-30T13:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Windows form on same screen as revit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10791174#M22084</link>
      <description>&lt;P&gt;You need to convert it to the appropriate data type. An example of how this can be done is provided by the module&amp;nbsp;CmdJumpToRevitPosition.cs in The Building Coder samples:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;      JtWindowHandle h = new JtWindowHandle( uiapp.MainWindowHandle );

      JumpToPosition jumper = new JumpToPosition( view, h );&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at the description of updating The Building Coder samples to use&amp;nbsp;MainWindowHandle:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2018/11/revit-window-handle-and-parenting-an-add-in-form.html#5" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2018/11/revit-window-handle-and-parenting-an-add-in-form.html#5&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please read the blog post more carefully before asking further questions. I wrote it to avoid having to repeat myself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 15:57:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/windows-form-on-same-screen-as-revit/m-p/10791174#M22084</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-11-30T15:57:24Z</dc:date>
    </item>
  </channel>
</rss>

