I created some ModelBuilder for some customization to reduce time in our routine process.
I exported my ModelBuilder to python script by availability of export options.
It doesn't work if i bring to tool bar.
any one suggest me clearly how to access the script in tool bar with some standard clear steps to follow?
as well as whether i need to do any modification on my exported python script?
Best Answer
Here is a list of things to consider before exporting models to Python:
If you expect to be overwriting data, set the overwriteOutput property to True. arcpy.env.overwriteOutput = True
Variables in your model are converted directly into Python variables in the exported script. You need to avoid naming your model variables the same as Python's reserved keywords (for example, class, global, return). For a full list of reserved keywords, use Python's keyword module.
If your model has an input variable type that is a FeatureSet or RecordSet, it will be exported as an in-memory feature class such as "in_memory\{E83BC42B-3578-4D20-A817-5F2AF3F5D05E}". You need to update this variable in Python with a path to a valid dataset or create a script tool where the input data type is a feature set.