<?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 Changing a Document when Selection Changed in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/changing-a-document-when-selection-changed/m-p/12747688#M5546</link>
    <description>&lt;P&gt;Revit don't let streching a rebar if the first rebar is not visible.&lt;/P&gt;&lt;P&gt;I would like to fix this behavior by changing the presentation mode to All when a rebar is selected, and set it back to as it was when unselected.&lt;/P&gt;&lt;P&gt;The API doc says it is "&lt;SPAN&gt;forbidden to make modifications to the current document" in the&amp;nbsp;SelectionChanged Event&amp;nbsp;Handlers.&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6352172935112w828h540r861" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6352172935112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6352172935112w828h540r861');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6352172935112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea how to solve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2024 08:13:50 GMT</pubDate>
    <dc:creator>atir5UTNF</dc:creator>
    <dc:date>2024-05-02T08:13:50Z</dc:date>
    <item>
      <title>Changing a Document when Selection Changed</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/changing-a-document-when-selection-changed/m-p/12747688#M5546</link>
      <description>&lt;P&gt;Revit don't let streching a rebar if the first rebar is not visible.&lt;/P&gt;&lt;P&gt;I would like to fix this behavior by changing the presentation mode to All when a rebar is selected, and set it back to as it was when unselected.&lt;/P&gt;&lt;P&gt;The API doc says it is "&lt;SPAN&gt;forbidden to make modifications to the current document" in the&amp;nbsp;SelectionChanged Event&amp;nbsp;Handlers.&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6352172935112w828h540r818" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6352172935112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6352172935112w828h540r818');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6352172935112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea how to solve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 08:13:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/changing-a-document-when-selection-changed/m-p/12747688#M5546</guid>
      <dc:creator>atir5UTNF</dc:creator>
      <dc:date>2024-05-02T08:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Changing a Document when Selection Changed</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/changing-a-document-when-selection-changed/m-p/12768822#M5547</link>
      <description>&lt;P&gt;My wildest guess is that you can create an ExternalEventHandler to change the display of rebar, then try to raise that event during SelectionChangedEvent. The ExternalEvent will run right after the SelectionChangedEvent.&lt;/P&gt;&lt;P&gt;However, I feel like this is not the proper approach since it might create more problems than what it can solve, if and only if the solution works. Showing rebar and make it viewed unobscured, and solid like can be a costly regeneration operation because it involves the view settings, not just rebar settings, especially when you have a large or complex BIM model. Besides, determine when and which rebar to restore to original state automatically can be quite a challenge, because you know which rebar is selected, but you don't know which rebar is RECENTLY UNSELECTED. Thus, the ExternalEvent may be executed multiple time unnecessarily.&lt;BR /&gt;&lt;BR /&gt;I would recommend you to create 2 separated, simple addin command to show all rebar and to restore rebar state. That is way simpler and you or user can assign short cut to it to work more efficiently.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 07:25:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/changing-a-document-when-selection-changed/m-p/12768822#M5547</guid>
      <dc:creator>longt61</dc:creator>
      <dc:date>2024-05-13T07:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Changing a Document when Selection Changed</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/changing-a-document-when-selection-changed/m-p/12769097#M5548</link>
      <description>&lt;P&gt;&lt;STRONG&gt;That's pretty much what I have done.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Shortcut to c&lt;/SPAN&gt;ommand that show all rebars.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 12:39:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/changing-a-document-when-selection-changed/m-p/12769097#M5548</guid>
      <dc:creator>atir5UTNF</dc:creator>
      <dc:date>2024-05-13T12:39:03Z</dc:date>
    </item>
  </channel>
</rss>

