<?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: Open Source Ifc Property Viewer in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607640#M54108</link>
    <description>&lt;P&gt;Currently, I'm doing it by using the Idling event.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;UiControlledApplication.Idling += OnIdling;&lt;BR /&gt;&lt;BR /&gt;internal static void OnIdling(object sender, IdlingEventArgs args)
        {
            var uiApplication = (UIApplication) sender;

            if (uiApplication.ActiveUIDocument == null)
                return;

            var selection = uiApplication.ActiveUIDocument.Selection;
            var oldValues = _selectedIds;
            var newValues = selection.GetElementIds();

            //Do what you want next
        }&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;from there, you can retreive old selection, new one, compare them, and know what elements are selected/unselected&lt;/P&gt;</description>
    <pubDate>Fri, 08 Dec 2017 10:08:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-12-08T10:08:09Z</dc:date>
    <item>
      <title>Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607602#M54106</link>
      <description>&lt;P&gt;I'm involved in an open source project that might be of interest and benefit to other Revit API developers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's available in an infant form at&amp;nbsp;&lt;A href="https://github.com/jmirtsch/RevitIfcPropertyBrowser" target="_blank"&gt;https://github.com/jmirtsch/RevitIfcPropertyBrowser&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Primarily it's a replica of the Revit property browser, when you select a single element or multiple elements, it displays the appropriate IFC properties as would be generated when exporting to IFC (Industry Foundation Class openBIM format).&amp;nbsp; An image is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many planned improvements for this project, including the ability to edit the revit parameters from the IFC properties (which permits the opportunity for some more interesting user interface controls for doing so).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will be posting some related questions and suggestions here in the following posts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jon&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="171208 ifc property browser.png" style="width: 615px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/436611i1CF25BC0C4FFC5DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="171208 ifc property browser.png" alt="171208 ifc property browser.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 09:53:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607602#M54106</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2017-12-08T09:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607613#M54107</link>
      <description>&lt;P&gt;First question related to the property browser.&amp;nbsp; It works well in the event of a user selecting an element (or multiple).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I can't find any way to detect when elements are unselected.&amp;nbsp; The browser retains the previous state.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions for changes to the code to identify this situation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 09:56:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607613#M54107</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2017-12-08T09:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607640#M54108</link>
      <description>&lt;P&gt;Currently, I'm doing it by using the Idling event.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;UiControlledApplication.Idling += OnIdling;&lt;BR /&gt;&lt;BR /&gt;internal static void OnIdling(object sender, IdlingEventArgs args)
        {
            var uiApplication = (UIApplication) sender;

            if (uiApplication.ActiveUIDocument == null)
                return;

            var selection = uiApplication.ActiveUIDocument.Selection;
            var oldValues = _selectedIds;
            var newValues = selection.GetElementIds();

            //Do what you want next
        }&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;from there, you can retreive old selection, new one, compare them, and know what elements are selected/unselected&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 10:08:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607640#M54108</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-08T10:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607661#M54109</link>
      <description>&lt;P&gt;That's a great suggestion.&amp;nbsp; I will look at implementing it ASAP.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 10:13:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607661#M54109</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2017-12-08T10:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607700#M54110</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are already using IExternalEvent. It can be raised from whatever you want, for example by .Net timer or another thread. I don't like Idle event and I am trying to avoid it due to performance reason.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 10:28:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607700#M54110</guid>
      <dc:creator>aignatovich</dc:creator>
      <dc:date>2017-12-08T10:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607768#M54111</link>
      <description>&lt;P&gt;I mostly agree with you.&lt;BR /&gt;&lt;BR /&gt;Idling event must be used with caution. Each registered event will be called repeatedly, unless you let the event remove itself. So you shouldn't register an event with an heavy workload. However, comparing selected ids is rather quick, and it's possible to do it in an async task.&lt;BR /&gt;&lt;BR /&gt;Moreover, if you need a a specific context that need to be constantly updated following the user selection, the idling event is probably the best way to do it.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 10:55:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607768#M54111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-08T10:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607790#M54112</link>
      <description>&lt;PRE&gt; public static class RevitSelection
    {
        private static int[] _selectedIds = new int[0];

        public static EventHandler&amp;lt;RevitSelectionChangedArgs&amp;gt; SelectionChanged;
        internal static Selection Selection { get; private set; }
        public static int[] SelectedIds
        {
            get =&amp;gt; _selectedIds;
            set
            {
                var oldValues = _selectedIds;

                if (oldValues.All(value.Contains) &amp;amp;&amp;amp; oldValues.Length == value.Length)
                    return;

                _selectedIds = value;
                Selection.SetElementIds(_selectedIds.Select(e =&amp;gt; new ElementId(e)).ToArray());
                SelectionChanged?.Invoke(null, new RevitSelectionChangedArgs(oldValues, value));
            }
        }

        internal static void OnIdling(object sender, IdlingEventArgs args)
        {
            var uiApplication = (UIApplication) sender;

            if (uiApplication.ActiveUIDocument == null)
                return;

            Selection = uiApplication.ActiveUIDocument.Selection;

            var oldValues = _selectedIds;
            var newValues = Selection.GetElementIds().Select(e =&amp;gt; e.IntegerValue).ToArray();

            if (oldValues.All(newValues.Contains) &amp;amp;&amp;amp; oldValues.Length == newValues.Length)
                return;

            _selectedIds = newValues;
            SelectionChanged?.Invoke(null, new RevitSelectionChangedArgs(oldValues, newValues));
        }
    }    &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class RevitSelectionChangedArgs : EventArgs&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; internal RevitSelectionChangedArgs(int[] oldSelection, int[] newSelection)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OldSelection = oldSelection;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewSelection = newSelection;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int[] OldSelection { get; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int[] NewSelection { get; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;This is the selection context class that I'm using in my plugin. It always worked well without performance issues for me.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 11:08:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/7607790#M54112</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-08T11:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/11168145#M54113</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1018275"&gt;@GeomGym&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Hi Jon, does anything like this exist now?&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 22:28:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/11168145#M54113</guid>
      <dc:creator>duncan.lithgow</dc:creator>
      <dc:date>2022-05-13T22:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/11168242#M54114</link>
      <description>&lt;P&gt;Sorry, I haven't touched this particular project in some time, and there's a few other developments that are a higher priority to pursue at present.&amp;nbsp; It is open source, so it should still work and others can work on it.&lt;/P&gt;</description>
      <pubDate>Sat, 14 May 2022 00:06:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/11168242#M54114</guid>
      <dc:creator>GeomGym</dc:creator>
      <dc:date>2022-05-14T00:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Open Source Ifc Property Viewer</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/11681899#M54115</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1018275"&gt;@GeomGym&lt;/a&gt;&amp;nbsp;with the current interest in incremental exchange of partial IFC data this is going to become more important.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.osarch.org/discussion/comment/12981/#Comment_12981" target="_blank"&gt;https://community.osarch.org/discussion/comment/12981/#Comment_12981&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/brunopostle/ifcmerge" target="_blank"&gt;https://github.com/brunopostle/ifcmerge&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 09:12:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-source-ifc-property-viewer/m-p/11681899#M54115</guid>
      <dc:creator>duncan.lithgow</dc:creator>
      <dc:date>2023-01-16T09:12:09Z</dc:date>
    </item>
  </channel>
</rss>

