<?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: Is there an event for when a viewpoint is selected? in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11787909#M1585</link>
    <description>&lt;P&gt;I would be interested to see what you came up with, please share. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 15:55:47 GMT</pubDate>
    <dc:creator>mtrainottiGHXJH</dc:creator>
    <dc:date>2023-02-28T15:55:47Z</dc:date>
    <item>
      <title>Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11786042#M1583</link>
      <description>&lt;P&gt;There is functionality to determine the currently selected viewpoint:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;SavedItem CurrentVp = Autodesk.Navisworks.Api.Application.ActiveDocument.SavedViewpoints.CurrentSavedViewpoint;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if the user clicks away that value becomes null.&lt;BR /&gt;&lt;BR /&gt;Because of this, I would like to store the last selected viewpoint but I cannot find in the documentation if there is an event that fires when a viewpoint is selected.&lt;BR /&gt;&lt;BR /&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 23:50:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11786042#M1583</guid>
      <dc:creator>mtrainottiGHXJH</dc:creator>
      <dc:date>2023-02-27T23:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11786402#M1584</link>
      <description>&lt;P&gt;Same issue here.&lt;/P&gt;&lt;P&gt;Very frustrating/inconsistent to have&lt;/P&gt;&lt;PRE&gt;Autodesk.Navisworks.Api.Application.ActiveDocument.SavedViewpoints.CurrentSavedViewpoint&lt;/PRE&gt;&lt;P&gt;changed to NULL even when the user does not change the item selected in&amp;nbsp;Saved Viewpoints pane!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Didn't find a publicly available solution.&lt;BR /&gt;I implemented a proof of concept HACK to track Saved Viewpoints selection via its docking pane.&lt;/P&gt;&lt;P&gt;Will try to make it clean/independent from other stuff and put it here.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 04:04:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11786402#M1584</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2023-02-28T04:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11787909#M1585</link>
      <description>&lt;P&gt;I would be interested to see what you came up with, please share. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 15:55:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11787909#M1585</guid>
      <dc:creator>mtrainottiGHXJH</dc:creator>
      <dc:date>2023-02-28T15:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11886871#M1586</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13494320"&gt;@mtrainottiGHXJH&lt;/a&gt;, Quick update,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&lt;U&gt;&lt;STRONG&gt;1/ re:&amp;nbsp;proof of concept HACK to track Saved Viewpoints selection via its docking pane:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;My wrong. The "Saved ViewPoints" pane is not even registered as a DockPanePlugin.&lt;/P&gt;&lt;P&gt;However this approach can be used for the "Sets" pane to get an ObservableCollection of selected Sets.&lt;/P&gt;&lt;P&gt;I will post an example separately if you are interested.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;2/ Now back to the "Saved ViewPoints" issue:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;and specifically, when a SavedViewPoint is still selected in&amp;nbsp;"Saved ViewPoints" pane BUT CurrentSavedViewpointChanged event is triggered and&amp;nbsp;d.SavedViewpoints.CurrentSavedViewpoint return null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Short term, I implemented a "hack" to handle such case by keeping "current" selected Saved VIew Point, and on such event, checking for unchanged Sectioning. Long term, I would like to rewrite our own Saved ViewPoints pane to replace the native one, that I guess is still a MFC or so remnant of old Navisworks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an extract of my class that track changes in Selection Sets and Saved View point, to get you started:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//CRITICAL, clear on d.SavedViewpoints.Reset etc. to avoid keeping an dangling object.
protected SavedViewpoint pSelectedSavedViewPoint;

static private bool IsStillSameViewPoint(Document d, SavedViewpoint previous)
{
	if (previous is null || previous.IsDisposed)
		return false;

	LcOaClipPlaneSet previous_cps = previous.Viewpoint.InternalClipPlanes;
	LcOaClipPlaneSet current_cps = d.CurrentViewpoint.Value.InternalClipPlanes;

	return current_cps.ValueEquals(previous_cps);
}

protected virtual void OnCurrentSavedViewpointChanged(object sender, EventArgs e)
{
	//// on click single item, called twice, null for deselect then null if folder, SavedViewpoint if an actual viewpoint for select
	//// on multiple items selected, seems just give the last one clicked not necessary the last one in the tree order?
	//// we can't predict if we will get called twice so no choice
	var d = sender as Document;

	//// if no items selected, si is null
	var si = d.SavedViewpoints.CurrentSavedViewpoint;

	var svp = si as SavedViewpoint;
	if (svp == pSelectedSavedViewPoint)
		return;

	if (si == null &amp;amp;&amp;amp; pSelectedSavedViewPoint != null &amp;amp;&amp;amp; IsStillSameViewPoint(d, pSelectedSavedViewPoint))
		return;

	var old = pSelectedSavedViewPoint;
	pSelectedSavedViewPoint = svp;
	OnSelectedSavedViewpointChanged(d, new SelecteSavedViewPointChangedEventArgs(old, svp));
}

protected virtual void OnSelectedSavedViewpointChanged(Document d, SelecteSavedViewPointChangedEventArgs e)
{ }&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Navisworks team, please consider reimplementing this "Saved ViewPoints" pane in C#, cleanly as a DockPanePlugin.&lt;/P&gt;&lt;P&gt;I'm so frustrated with the current pane unpredictable drag &amp;amp; drop that works like once at of 4 times I can't imagine how many screens and keyboard have been destroyed just because of this&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So you will make not only developers happybut lots of users I guess.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 06:42:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11886871#M1586</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2023-04-11T06:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11888631#M1587</link>
      <description>&lt;P&gt;I ended up doing essentially the same thing, for my use case however I didn't need to check if it was different saved viewpoint so I just stored it as SavedItem and check for null on use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 18:17:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11888631#M1587</guid>
      <dc:creator>mtrainottiGHXJH</dc:creator>
      <dc:date>2023-04-11T18:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11888639#M1588</link>
      <description>&lt;P&gt;For future readers:&lt;BR /&gt;&lt;BR /&gt;The event for a change in the selected saved viewpoint is:&amp;nbsp; Autodesk.Navisworks.Api.Application.ActiveDocument.SavedViewpoints.CurrentSavedViewpointChanged;&lt;BR /&gt;&lt;BR /&gt;You can bind this event to a method with: Autodesk.Navisworks.Api.Application.ActiveDocument.SavedViewpoints.CurrentSavedViewpointChanged += &amp;lt;your_method_here&amp;gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 18:20:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/11888639#M1588</guid>
      <dc:creator>mtrainottiGHXJH</dc:creator>
      <dc:date>2023-04-11T18:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12053967#M1589</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5661631"&gt;@naveen.kumar.t&lt;/a&gt;&amp;nbsp;Please please, plead for us with the Engineering team.&lt;BR /&gt;&lt;BR /&gt;We could do so many things if we can access the list of selected items in Saved Viewpoints, cf picture below.&lt;BR /&gt;Things like merging, renaming, grouping etc, not to mention Plugin specific features.&lt;BR /&gt;This would also settle cleanly the issue described in this thread instead of having really ugly and unreliable hacks.&lt;BR /&gt;&lt;BR /&gt;Even if not officially supported, at our own risk, or need to sign a NDA with our blood, I'm fine as long as we can do it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alexisDVJML_0-1687460036759.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1231899iA837562406B94A48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alexisDVJML_0-1687460036759.png" alt="alexisDVJML_0-1687460036759.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 18:57:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12053967#M1589</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2023-06-22T18:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12054895#M1590</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6001790"&gt;@alexisDVJML&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I submitted a ticket to the Navisworks engineering team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://jira.autodesk.com/browse/NW-59274" target="_blank" rel="noopener"&gt;NW-59274&lt;/A&gt;&lt;/STRONG&gt; -&amp;nbsp;Expose Viewpoint selected events in the .NET API&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 05:59:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12054895#M1590</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2023-06-23T05:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12056359#M1591</link>
      <description>&lt;P&gt;It is also possible to make your own WPF tree view and interact with the api, such that you can keep track of which items are selected yourself. I actually started a mockup design of one a while back. It is definitely a good bit of work, but it would allow you to have custom UI elements in the saved viewpoint panel as well. Not trying to discount the idea of Navis exposing the selected elements, as that is a far more convenient solution haha.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 16:09:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12056359#M1591</guid>
      <dc:creator>mtrainottiGHXJH</dc:creator>
      <dc:date>2023-06-23T16:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12060785#M1592</link>
      <description>Yupz, I also considered this out of frustration &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;I however asked my plugin users and they said it would be even more confusing/frustrating if they forgot to use the correct pane etc...</description>
      <pubDate>Mon, 26 Jun 2023 12:49:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12060785#M1592</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2023-06-26T12:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12060789#M1593</link>
      <description>Thanks a lot.</description>
      <pubDate>Mon, 26 Jun 2023 12:49:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12060789#M1593</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2023-06-26T12:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an event for when a viewpoint is selected?</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12060792#M1594</link>
      <description>And yes this is some work, kind of duplicated with the existing one.&lt;BR /&gt;Will revisit this idea if really can't go around.</description>
      <pubDate>Mon, 26 Jun 2023 12:51:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/is-there-an-event-for-when-a-viewpoint-is-selected/m-p/12060792#M1594</guid>
      <dc:creator>alexisDVJML</dc:creator>
      <dc:date>2023-06-26T12:51:01Z</dc:date>
    </item>
  </channel>
</rss>

