<?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 Returning to Current Time from a Historical Moment in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1548850#M12174</link>
    <description>&lt;P&gt;I am trying to make an add-in that allows a user to switch between multiple historical moments for a feature service. I also want to allow switching to the default view, sans historical moments. In the Pro UI, there is a radio button that allows you to return to the current time, and reflects that in the data source view of the contents panel. Unfortunately, I can't figure out how to replicate that functionality in my add-in.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to switch versions with Map.ChangeVersion, but getting the default from version manager (GetDefaultVersion) and switching to that does nothing, and switching to DateTime.Now just places the feature service in another historical moment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="returntocurrenttime.png" style="width: 325px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117285i04D1D4CDF9AF4A52/image-dimensions/325x616?v=v2" width="325" height="616" role="button" title="returntocurrenttime.png" alt="returntocurrenttime.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Oct 2024 21:01:55 GMT</pubDate>
    <dc:creator>Gfreitag</dc:creator>
    <dc:date>2024-10-15T21:01:55Z</dc:date>
    <item>
      <title>Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1548850#M12174</link>
      <description>&lt;P&gt;I am trying to make an add-in that allows a user to switch between multiple historical moments for a feature service. I also want to allow switching to the default view, sans historical moments. In the Pro UI, there is a radio button that allows you to return to the current time, and reflects that in the data source view of the contents panel. Unfortunately, I can't figure out how to replicate that functionality in my add-in.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to switch versions with Map.ChangeVersion, but getting the default from version manager (GetDefaultVersion) and switching to that does nothing, and switching to DateTime.Now just places the feature service in another historical moment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="returntocurrenttime.png" style="width: 325px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117285i04D1D4CDF9AF4A52/image-dimensions/325x616?v=v2" width="325" height="616" role="button" title="returntocurrenttime.png" alt="returntocurrenttime.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 21:01:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1548850#M12174</guid>
      <dc:creator>Gfreitag</dc:creator>
      <dc:date>2024-10-15T21:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1548937#M12179</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Have you seen that &lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-amp-change-moment/m-p/1315329" target="_self"&gt;thread&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 10:20:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1548937#M12179</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2024-10-16T10:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549125#M12180</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Yes I did, this thread was how I learned how to switch to historical moments. But I'm still not sure how to revert to current time after switching.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 16:29:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549125#M12180</guid>
      <dc:creator>Gfreitag</dc:creator>
      <dc:date>2024-10-16T16:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549174#M12181</link>
      <description>&lt;P&gt;Have you tried to read current version before changing and save it for later using?&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;private ArcGIS.Core.Data.Version _fromVersion; 

private Task ChangeToHistoricVersion()
{

// Before changing to historic version
_fromVersion = versionManager.GetCurrentVersion();




}

private Task ChangeToCurrentVersion()
{

// changing back to current version
MapView.Active.Map.ChangeVersion(historicalVersion, _fromVersion);

}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 18:09:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549174#M12181</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2024-10-16T18:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549516#M12187</link>
      <description>&lt;P&gt;Create a historical version with &lt;STRONG&gt;DateTime.Now&lt;/STRONG&gt;, and switch to it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HistoricalVersionDescription historicalVersionDescription = new HistoricalVersionDescription(versionName, DateTime.Now);&lt;BR /&gt;HistoricalVersion historicalVersion = versionManager.CreateHistoricalVersion(historicalVersionDescription);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 14:36:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549516#M12187</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2024-10-17T14:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549604#M12189</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for the reply. I'm not sure this is possible, since I am trying to switch the moments for a feature service. Correct me if I'm wrong, but named historical moments for feature services are not supported. When trying to create a historical version, I get the error: "System.NotSupportedException: 'The underlying data store does not support this operation.'"&lt;/P&gt;&lt;P&gt;To switch to a specific date/time, I usually call version_manager.GetHistoricalVersion(date);&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an alternative?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 17:07:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549604#M12189</guid>
      <dc:creator>Gfreitag</dc:creator>
      <dc:date>2024-10-17T17:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549607#M12190</link>
      <description>&lt;P&gt;This may work, but it's not a viable solution for me, as the user might open a project with a feature service already on a historical moment. They can also switch between historical moments multiple times. I'm not sure how to differentiate between a historical moment and the current one.&lt;/P&gt;&lt;P&gt;There must be a way, I wish I could peek at the underlying code of that radio button&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 17:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549607#M12190</guid>
      <dc:creator>Gfreitag</dc:creator>
      <dc:date>2024-10-17T17:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549623#M12192</link>
      <description>&lt;P&gt;&lt;EM&gt;VersionManager.CreateHistoricalVersion&lt;/EM&gt; creates a named historical version in an enterprise geodatabase. As you noted, feature services do not support this.&lt;/P&gt;
&lt;P&gt;To connect to an historical moment, create an &lt;EM&gt;HistoricalVersion&lt;/EM&gt; object using &lt;EM&gt;VersionManager.GetHistoricalVersion(DateTime)&lt;/EM&gt;, then pass it to &lt;EM&gt;Mapview.Active.Map.ChangeVersion()&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 17:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549623#M12192</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2024-10-17T17:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Returning to Current Time from a Historical Moment</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549695#M12193</link>
      <description>&lt;P&gt;Yes I know, my issue is returning to the current moment from a historical moment, rather than switching to one in the first place. I have used the method above to connect to one. I now need to remove that and just see the default, which is the behavior achieved by the "return to current time" button in the History Dockpane.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 19:59:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/returning-to-current-time-from-a-historical-moment/m-p/1549695#M12193</guid>
      <dc:creator>Gfreitag</dc:creator>
      <dc:date>2024-10-17T19:59:40Z</dc:date>
    </item>
  </channel>
</rss>

