I'm trying to write an Add-In to ArcMap that will allow users to perform traces on a geometric network and symbolise features linked to affected portions of the network.
The user clicks on the network to specify a flag and the script carries out a trace with a predefined feature class of barriers to find out the immediately isolated network. The script then successfully exports the results of this trace from the resultant group layer to a new feature class.
My problem lies accessing the results of the next trace on the geometric network from the Add-In. The next trace should identify affected elements based on the isolation from the first trace. This second trace works fine and the resultant group layer is displayed in the table of contents with expected elements of the network selected. However, I cannot access the selected features in my script to then export the affected network to a new feature class. Manually exporting from within ArcMap works fine, but exporting from the script returns the entire network - not the selection.
I've tried specifying the name of the resultant group layer in the script and then accessing the sublayer with the selection, but the portion of code after the IF statements doesn't trigger which suggests that the group layer is somehow invisible to the script.
Does anybody have any ideas?
Thanks in advance.