Originally Posted by
Duncan Kitts
This query will take a selected node, trace upstream, refine the selection to include subcatchment, deslect all objects other than the subcatchments:-
UPDATE [ALL Links] SET $link_selected = 0;
UPDATE [ALL Nodes] SET $node_selected = 0;
UPDATE SELECTED SET $node_selected = 1;
LET $count = 0;
WHILE $count < 100;
SET us_links.$link_selected = 1 WHERE $node_selected = 1;
UPDATE [ALL Links] SET us_node.$node_selected = 1 WHERE $link_selected = 1;
LET $count = $count + 1;
WEND;
SELECT FROM [All Nodes] WHERE $node_selected = 1;
UPDATE Subcatchment SET $subcatchment_selected =0;
UPDATE SELECTED SET subcatchments.$subcatchment_selected =1;
SELECT FROM Subcatchment WHERE $subcatchment_selected =1;
DESELECT ALL
The while keyword will select all nodes upstream for a count of 100. If you need this to be larger you can edit the number as required.