-2

I made this gui for my tool. where, input feature class = shape file input, Field = select some field from input given in input, area = area field from input, output feature class= output path

My problem is that i want to solve one equation by using these inputs.

Equation is : (field*area)/total area where field= fields which are selected, Area= field of area, total area= total of area.

The result of this process is store in another new field. I am using python 9.3.

Give me some idea to solve this by using python.

1 Answer 1

1

You can create a new parameter for the output field. Then create an expression that handles your formula in the execute folder. Something like this:

# Output Parameter
    Output_field = arcpy.Parameter(
                           displayName = "Output",
                           name = "Output_field",
                           datatype = "field",
                           parameterType = "Derived",
                           direction = "Output"
                                 )
   Output_field.ParameterDependency = ("in_features)

    #Add other parameters to the list                       
    params = ["Output_field",......]
    return params

You will need to update your parameters then fill the execute method

1
  • thank u for reading my question. I already created output parameter. I cant understand what you answered. i just want to solve that equation. and want to store output in input file.
    – Shivani
    Commented Feb 2, 2015 at 16:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.