<?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 Re: Modelbuilder: Select value from .dbf and use this value to calculate further in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300514#M10425</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote the script in Python. In ArcGIS I added the script via right mouse click, add script. I wrote down the name of the script, the alias and a brief description. In the next view I searched for the script and I imported the script. So far so good I thought. Then the next screen came;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With a little logic I filled in this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@ - Input - Table (Required)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@ - Output - Table View (Derived, obtained from input).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fingers crossed and let it do a test run. So I my model looks like this (see attachment; yeah I know it looks crappy :-), it was made with good old MS Paint; my current workstation has no internet).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the information above, i try to connect my output with the script. It gives an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000840: The Value is not a table. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think my script tool has wrong parameters. unfortunately i cannot think of an other data type to select at the 'add script menu'. Because my main datafile is an .xls or .dbf file (and therefor a table) (I figured out that it doesn't matter which one I selected). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully you could help me. Thanks in advance though!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yours,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Nov 2010 09:41:40 GMT</pubDate>
    <dc:creator>MarkVerlaat</dc:creator>
    <dc:date>2010-11-11T09:41:40Z</dc:date>
    <item>
      <title>Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300510#M10421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good day all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pretty new to modelbuilding and geoprocessing, I'm stuck at one place in my modelbuilder. I would like to do the following thing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a .dbf file, which has a list of vehicles and a couple of vehicle characteristics (for example the width). If the user selects the vehicle of his desire, the model needs to grab this value and use it to calculate if this vehicle can drive upon a road. I have a shapefile with roads and how wide they are. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To select the vehicle and to manually select a width is not a problem. The problem is the connection between those two. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a geoprocessing tool or do I have to write a Python script? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark Verlaat&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Netherlands&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 06:40:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300510#M10421</guid>
      <dc:creator>MarkVerlaat</dc:creator>
      <dc:date>2010-11-09T06:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300511#M10422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're using 10.0, there is a Model-Only tool you can use called Get Field Value.&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Get_Field_Value/004000000006000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Get_Field_Value/004000000006000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can only use Get Field Value in ModelBuilder.&amp;nbsp; It is accessed from the ModeBuilder menu (Insert &amp;gt; Model Only Tools).&amp;nbsp; See &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Accessing_Model_Only_tools/002w00000066000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Accessing_Model_Only_tools/002w00000066000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Get Field Value was introduced at 10.0.&amp;nbsp; If you don't have 10.0, you'll have to write a script tool.&amp;nbsp; I thought I had this implemented and could attach the script, but unfortunately I can't find it.&amp;nbsp; The logic is fairly simple... The script takes two arguments, a table and a field.&amp;nbsp; A cursor is opened on the input table and the value of the field is retrieved from the first record of the input table.&amp;nbsp; The value is output as the third parameter (i.e., SetParameterAsText(2) ).&amp;nbsp; Here's the basic (untested) code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting
gp = arcgisscripting.create(9.3)
intable = gp.GetParameterAsText(0)
infield = gp.GetParametersAsText(1)

# open cursor
rows = gp.searchcursor(intable)
row = rows.next()
fval = row.GetValue(infield)
gp.SetParameterAsText(2, str(fval))
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For more help on creating script tools, start here: &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_creating_script_tools" rel="nofollow noopener noreferrer" target="_blank"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_creating_script_tools&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:24:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300511#M10422</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2021-12-11T14:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300512#M10423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately we have 9.3, so I have to write a script. I will test this tomorrow (GMT +1). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, let me get this clear. The user has to select the vehicle. With the vehicle selected, this script will execute my next tools in the modelbuilder. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I keep you posted!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 17:04:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300512#M10423</guid>
      <dc:creator>MarkVerlaat</dc:creator>
      <dc:date>2010-11-09T17:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300513#M10424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What this tool does is output the value of a specific field in the first row of a table (or feature class).&amp;nbsp; The workflow is that the user selects a single row in a table (the row with your vehicle characteristics, I guess).&amp;nbsp; The script reads this row and outputs a value (an oval in ModelBuilder).&amp;nbsp; You then use this value in downstream processes.&amp;nbsp; So the script doesn't execute anything -- it just outputs a value that you use in ModelBuilder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take a look at the discussion in this topic:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00400000001m000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00400000001m000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scroll down until you find the discussion of Get Field Value.&amp;nbsp; It shows an example model using Get Field Value and in-line variable substitution.&amp;nbsp; (The script tool I suggested does the same thing as Get Field Value).&amp;nbsp; This is 10.0 documentation, but it would work exactly the same way in 9.3&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 17:10:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300513#M10424</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2010-11-09T17:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300514#M10425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote the script in Python. In ArcGIS I added the script via right mouse click, add script. I wrote down the name of the script, the alias and a brief description. In the next view I searched for the script and I imported the script. So far so good I thought. Then the next screen came;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With a little logic I filled in this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@ - Input - Table (Required)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@ - Output - Table View (Derived, obtained from input).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fingers crossed and let it do a test run. So I my model looks like this (see attachment; yeah I know it looks crappy :-), it was made with good old MS Paint; my current workstation has no internet).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the information above, i try to connect my output with the script. It gives an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000840: The Value is not a table. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think my script tool has wrong parameters. unfortunately i cannot think of an other data type to select at the 'add script menu'. Because my main datafile is an .xls or .dbf file (and therefor a table) (I figured out that it doesn't matter which one I selected). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully you could help me. Thanks in advance though!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yours,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 09:41:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300514#M10425</guid>
      <dc:creator>MarkVerlaat</dc:creator>
      <dc:date>2010-11-11T09:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300515#M10426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your 1st parameter is a Table View&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your 2nd parameter is a Field, Obtained From is set to the first parameter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;These first two parameters are required inputs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your 3rd parameter is a String and is a derived output.&amp;nbsp; Obtained From is blank&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 15:30:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300515#M10426</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2010-11-11T15:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300516#M10427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good afternoon dmhoneycutt and others,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you for your help. It works great. However, i think I need your expertise one more time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote a script, which applies the symbology. I wrote it, so the only thing I need is the output from the GetValue script. And that is just the thing I can't write... When I manually enter the value I got from the GetValue script, the model runs perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script looks something like this: (do not mind the Dutch words; those are file names)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import sys, string, os, arcgisscripting

gp = arcgisscripting.create()
gp.AddToolbox("filepath/Data Management Tools.tbx")
gp.AddToolbox("filepath/Mark Toolbox.tbx")

String = ? #This has to be the value from the GetValue script
VCI_Laag = "filepath\\Symbology_Files\\"+String +".lyr"
Grondsoorten_Verzadigd = "Grondsoorten_Verzadigd"

gp.ApplySymbologyFromLayer_management(Grondsoorten_Verzadigd, VCI_Laag)&lt;/PRE&gt;&lt;SPAN&gt;The parameters I used are: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1st: Input = String (From the GetValue script) Required&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2nd: Input = Layer (Grondsoorten_Verzadigd, is a shapefile) Required&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3rd: Output = Layer (Which combines the shapefile and symbology) Derived; obtained from Layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe you could help me with the sentence I need to fill at the 'String'. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need more info, please ask me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:24:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300516#M10427</guid>
      <dc:creator>MarkVerlaat</dc:creator>
      <dc:date>2021-12-11T14:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300517#M10428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I thought a from ... import code will work. But unfortunately it doesn't.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import sys, string, os, arcgisscripting&amp;nbsp; 
gp = arcgisscripting.create() 
gp.AddToolbox("filepath/Data Management Tools.tbx") 
gp.AddToolbox("filepath/Mark Toolbox.tbx") 

&lt;STRONG&gt;from getValue import *&lt;/STRONG&gt;

String = &lt;STRONG&gt;fval&lt;/STRONG&gt; #This has to be the value from the GetValue script 
VCI_Laag = "filepath\\Symbology_Files\\"+String +".lyr" 
Grondsoorten_Verzadigd = "Grondsoorten_Verzadigd"
gp.ApplySymbologyFromLayer_management(Grondsoorten_Verzadigd, VCI_Laag)
&lt;/PRE&gt;&lt;SPAN&gt;In bold are the changes I tried to make. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Error it gives in ArcGIS is a ERROR 999999: Error executing function. A locator with this name does not exist. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If import the getValue.py script in Python it gives an error. (The same as in ArcGIS).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't stand it, because I know it's something small (I think it is :)).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could someone help me? Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:24:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300517#M10428</guid>
      <dc:creator>MarkVerlaat</dc:creator>
      <dc:date>2021-12-11T14:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder: Select value from .dbf and use this value to calculate further</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300518#M10429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I finally figured it out! I thought, let's combine those two scripts in one. And a miracle happend. It works!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It leaves me with a question though. Why didn't the from getValue import * code work? I had both files in the same folder, but it didn't work. Anyone knows why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I entered an extra parameter for the script. The first 3 dmhoneycutt gave me; the fourth was Layer which is an required input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to thank dmhoneycutt for his help&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 07:51:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-select-value-from-dbf-and-use-this/m-p/300518#M10429</guid>
      <dc:creator>MarkVerlaat</dc:creator>
      <dc:date>2010-11-17T07:51:33Z</dc:date>
    </item>
  </channel>
</rss>

