<?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 Detecting a change of network analyst layer in a Toolbarbean control in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/detecting-a-change-of-network-analyst-layer-in-a/m-p/736056#M19553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am developing a visual app using the ArcObjects Java API. I have a ToolbarBean, with a ControlsNetworkAnalystLayerToolControl item on it, which I use to select the network dataset that is going to be the subject of the app analyses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to have an event that detects when the user update that control, changing the current network dataset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried to use an onItemClick for the Toolbar, but it is not triggered by the NetworkAnalystLayer control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another solution could be to call a "Select data" dialog box similar to the one triggered by the ControlsAddDataCommand item but where only network datasets would be shown.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or there might be another way to do that? Basically, I just want to select a network dataset and perform some preparatory analyses before giving the hand to the user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to ArcObjects programming and any help or pointer will be welcome. Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jan 2011 06:17:35 GMT</pubDate>
    <dc:creator>AlexandreHirzel</dc:creator>
    <dc:date>2011-01-18T06:17:35Z</dc:date>
    <item>
      <title>Detecting a change of network analyst layer in a Toolbarbean control</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/detecting-a-change-of-network-analyst-layer-in-a/m-p/736056#M19553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am developing a visual app using the ArcObjects Java API. I have a ToolbarBean, with a ControlsNetworkAnalystLayerToolControl item on it, which I use to select the network dataset that is going to be the subject of the app analyses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to have an event that detects when the user update that control, changing the current network dataset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried to use an onItemClick for the Toolbar, but it is not triggered by the NetworkAnalystLayer control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another solution could be to call a "Select data" dialog box similar to the one triggered by the ControlsAddDataCommand item but where only network datasets would be shown.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or there might be another way to do that? Basically, I just want to select a network dataset and perform some preparatory analyses before giving the hand to the user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to ArcObjects programming and any help or pointer will be welcome. Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 06:17:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/detecting-a-change-of-network-analyst-layer-in-a/m-p/736056#M19553</guid>
      <dc:creator>AlexandreHirzel</dc:creator>
      <dc:date>2011-01-18T06:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting a change of network analyst layer in a Toolbarbean control</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/detecting-a-change-of-network-analyst-layer-in-a/m-p/736057#M19554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've found the answer, and I thought I might as well post it here, for those coming after me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the initialisation method, I put the following lines:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
EngineNetworkAnalystEnvironment nae = new EngineNetworkAnalystEnvironment();
nae.addIEngineNetworkAnalystEnvironmentEventsListener(new IEngineNetworkAnalystEnvironmentEvents() {

&amp;nbsp; public void onNetworkLayersChanged(IEngineNetworkAnalystEnvironmentEventsOnNetworkLayersChangedEvent theEvent) throws IOException, AutomationException {
&amp;nbsp; }

&amp;nbsp; public void onCurrentNetworkLayerChanged(IEngineNetworkAnalystEnvironmentEventsOnCurrentNetworkLayerChangedEvent theEvent) throws IOException, AutomationException {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onCurrentNetworkLayerHasChanged(theEvent);
&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And then I wrote this event handler method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private void onCurrentNetworkLayerHasChanged(IEngineNetworkAnalystEnvironmentEventsOnCurrentNetworkLayerChangedEvent evt){
&amp;nbsp; txtResults.append("Network layer has changed!");
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:22:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/detecting-a-change-of-network-analyst-layer-in-a/m-p/736057#M19554</guid>
      <dc:creator>AlexandreHirzel</dc:creator>
      <dc:date>2021-12-12T07:22:34Z</dc:date>
    </item>
  </channel>
</rss>

