http://resources.arcgis.com/en/help/main/10.1/index.html#//00570000004w000000
This has the following code sample:
<SPAN class="kn" style="color: #0000ff;">import</SPAN> <SPAN class="nn">arcpy</SPAN><BR /><SPAN class="kn" style="color: #0000ff;">import</SPAN> <SPAN class="nn">time</SPAN><BR /><BR /><SPAN class="n">arcpy</SPAN><SPAN class="o">.</SPAN><SPAN class="n">ImportToolbox</SPAN><SPAN class="p">(</SPAN><SPAN class="s" style="color: #a31515;"><SPAN>"</SPAN><A class="jive-link-external-small" href="http://sampleserver1.arcgisonline.com/ArcGIS/services;Elevation/ESRI_Elevation_World" rel="nofollow noopener noreferrer" target="_blank">http://sampleserver1.arcgisonline.com/ArcGIS/services;Elevation/ESRI_Elevation_World</A><SPAN>"</SPAN></SPAN><SPAN class="p">,</SPAN> <SPAN class="s" style="color: #a31515;">"viewshedAlias"</SPAN><SPAN class="p">)</SPAN><BR /><BR /><SPAN class="n">result</SPAN> <SPAN class="o">=</SPAN> <SPAN class="n">arcpy</SPAN><SPAN class="o">.</SPAN><SPAN class="n">Viewshed_viewshedAlias</SPAN><SPAN class="p">(</SPAN><SPAN class="s" style="color: #a31515;">r'c:\data\inputPoint.shp'</SPAN><SPAN class="p">,</SPAN> <SPAN class="s" style="color: #a31515;">"10000 Kilometers"</SPAN><SPAN class="p">)</SPAN><BR /><BR /><SPAN class="k" style="color: #0000ff;">while</SPAN> <SPAN class="n">result</SPAN><SPAN class="o">.</SPAN><SPAN class="n">status</SPAN> <SPAN class="o"><</SPAN> <SPAN class="mi" style="color: #666666;">4</SPAN><SPAN class="p">:</SPAN><BR /> <SPAN class="k" style="color: #0000ff;">print</SPAN> <SPAN class="n">result</SPAN><SPAN class="o">.</SPAN><SPAN class="n">status</SPAN><BR /> <SPAN class="n">time</SPAN><SPAN class="o">.</SPAN><SPAN class="n">sleep</SPAN><SPAN class="p">(</SPAN><SPAN class="mf" style="color: #666666;">0.2</SPAN><SPAN class="p">)</SPAN><BR /><SPAN class="k" style="color: #0000ff;">print</SPAN> <SPAN class="s" style="color: #a31515;">"Execution Finished"</SPAN><BR /><BR /><SPAN class="n">result</SPAN><SPAN class="o">.</SPAN><SPAN class="n">getMessages</SPAN><SPAN class="p">()</SPAN><BR /><SPAN class="n">arcpy</SPAN><SPAN class="o">.</SPAN><SPAN class="n">CopyFeatures_management</SPAN><SPAN class="p">(</SPAN><SPAN class="n">result</SPAN><SPAN class="o">.</SPAN><SPAN class="n">getOutput</SPAN><SPAN class="p">(</SPAN><SPAN class="mi" style="color: #666666;">0</SPAN><SPAN class="p">),</SPAN> <SPAN class="s" style="color: #a31515;">'localResult.shp'</SPAN><SPAN class="p">)</SPAN>
With this sample above, I don't get the alias here. They import the toolbox and give it an alias, but how does the following line know the alias? viewshedAlias is not part of arcpy.
result = arcpy.Viewshed_viewshedAlias(r'c:\data\inputPoint.shp', "10000 Kilometers")
I tried something like this:
arcpy.ImportToolbox(r"http://myserver/arcgis/rest/services;aFolder/aTool", "myTool")
result = myTool(r'C:\gisProject\default.gdb\aPoint', "1000 Feet")
...but it errors saying 'myTool' is not defined. What am I missing about the alias?