Run TraceAllFeeders via a Command Line
Running the tool from a command line allows you to trace all feeders in the network or trace a designated subset of feeders using command line arguments.
Further, you can save the geometric network as a part of the command instead of having to choose it each time you run the tool.
Command Line with no Arguments
If you include no arguments, the tool traces all feeders in the selected geometric network just like double-clicking the executable. In other words, you can run the executable from the command line instead of double-clicking the icon.
The tool runs in an identical fashion as double-clicking the icon in the bin directory.
Command Line with Arguments
To refine the executable, you can add the following command line arguments:
Argument |
Description |
---|---|
-n |
This argument specifies the number of feeders to be traced. For example, if you want to trace 10 feeders at a time, the command line is: C:\Program Files (x86)\Miner and Miner\ArcFM Solution\Bin>traceallfeeders.exe -n 10
With this argument, you are still prompted to choose a geometric network. The tool needs to track which feeders it has traced, and which it has not. In other words, if you had 50 total feeders and you are tracing 10 at a time, it needs to know where to “pick up” the procedure on subsequent runs. To accomplish this, the tool creates a file called TraceAllFeedersSnapshot.dat file. By default, the file is created in C:\Users\username\AppData\Roaming\Miner and Miner\ArcFM. If this file does not exist, the user is provided with a Yes/No prompt to create the file. Select Yes to create the file and No to stop the trace without creating the file. |
-f |
This argument is required only if you decide to move the TraceAllFeedersSnapshot.dat file to a different directory than the default (C:\Users\username\AppData\Roaming\Miner and Miner\ArcFM). In other words, if you leave the .dat file in the default directory, you do not need this argument. But, if you move the .dat file, then this argument lets you specify the new location. For example, if you moved the .dat file to a folder called C:\TraceProgess, the command line is: C:\Program Files (x86)\Miner and Miner\ArcFM Solution\Bin>traceallfeeders.exe
-f "C:\TraceProgress\TraceAllFeedersSnapshot.dat"
With this argument, you are still prompted to choose a geometric network. The tool locates the .dat file and displays the progress information. You can then confirm to pick up from where it left off or start from the beginning. The .dat file is automatically deleted once all feeders have been traced. Further, the version of the snapshot must be compatible with the version of your application. In other words, if you upgrade your applications, do not use a snapshot file created from a previous version. |
-n -f |
You can combine the two arguments above into the same command line. For example, if you want to:
Then, the final command line is: C:\Program Files (x86)\Miner and Miner\ArcFM Solution\Bin>traceallfeeders.exe -n 10
-f "C:\TraceProgress\TraceAllFeedersSnapshot.dat"
|
-connection file -network -headless |
With both arguments above (-n and -f), you still need to choose the geometric network manually. If you always run the command against the same geometric network, this set of arguments lets you embed the network in the command. This means you do not have to select the network every time you run the tool. To use the -headless argument, you need the location of the exclusive SDE database connection file you created for TraceAllFeeders. Connection files are stored in C:\Users\username\AppData\Roaming\ESRI\Desktop10.6\ArcCatalog. This informs the -connectionfile argument.
TIP:
You also need the name of the geometric network. The easiest way to find the name is to look at the network in the ArcCatalog > Catalog Tree. This informs the -network argument
TIP: When you type the name of the network into the command
line, it is not case sensitive.
With these pieces, you can assemble your argument. For example, using the connection file and network seen above, the command line is: C:\Program Files (x86)\Miner and Miner\ArcFM Solution\Bin>traceallfeeders.exe
-connectionfile "C:\Users\username\AppData\Roaming\ESRI\Desktop10.6\ArcCatalog\
Minerville_Trace All Feeders Connection.sde"
-network minerville.ARCFM.ElecGeomNetwork -headless
When using these arguments, the completion dialog is suppressed and does not appear when the traces are done. |
Create a Shortcut that Includes your Arguments
As you can see above, combining arguments can result in a long command line. Instead of typing (or copying and pasting) the command each time, embed it into a shortcut. To do so:
-
Browse to TraceAllFeeders.exe. By default, this file is located in C:\Program Files (x86)\Miner and Miner\ArcFM Solution\Bin.
-
Right-click TraceAllFeeders.exe and choose Create Shortcut. This creates a shortcut file in the same directory. You can rename this file.
-
Right-click the shortcut file and select Properties.
-
Click the Shortcut tab and locate the Target field.
-
At the end of the file path in the Target field, type or paste your command line arguments.
IMPORTANT: This field accepts up to 259 characters. Given your file directory and naming conventions for your connection file and network, there might not be enough room to include the -connectionfile, -network, and-headless arguments using the default directory. If you encounter this limit, try moving the TraceAllFeeders.exe to a shorter file path on your system. -
Click OK to save changes and dismiss the Properties window.
Now, when you double-click the shortcut, it includes the command line arguments.