Select to view content in your preferred language

Convert exported Python code to Arc Model (AML)

805
4
11-02-2010 08:24 AM
PageWeil
Emerging Contributor
I recently lost a large model that I put >16 hours into due to a miscommunication regarding file backups.  The only copy I can find of this model was exported as Python code.  I cannot think in Python code and need to convert this model back to an Arc Model.  The model was not modified at all once it was converted to Python; it contains only the code generated from the original Arc model.  How can I convert this code to an Arc Model?

This would be an extremely useful feature for Arc so that models could be converted to and from Python and a version tracking system could be put in place.

Please help!
0 Kudos
4 Replies
ChrisSnyder
Honored Contributor
Sorry, but as far as I know there is no "Python Script to Model Builder" utility.

Also, I think you mean Model Builder as apposed to AML (Arc Macro Language), which is the good ole' (and personally still loved) scripting language for ArcInfo Workstation command line, right?
0 Kudos
PageWeil
Emerging Contributor
Yes, I do mean ModelBuilder.  It would be amazing if this tool existed, but I may have to rebuild the model from scratch...
0 Kudos
LoganPugh
Frequent Contributor
It would probably take less time and be more useful in the long run to learn the basics of Python scripting. You've already got the code, so read some of the tutorials and the ArcGIS Help to learn how to tidy it up and even turn it into a script tool (usable from ArcToolbox and in ModelBuilder) if you so desired.
0 Kudos
ChrisSnyder
Honored Contributor
It would probably take less time and be more useful in the long run to learn the basics of Python scripting. You've already got the code, so read some of the tutorials and the ArcGIS Help to learn how to tidy it up and even turn it into a script tool (usable from ArcToolbox and in ModelBuilder) if you so desired.


I second Logan's advice. The sooner you ditch MB, the better. You will be glad you did! The grass is much greener on the other side...
0 Kudos