extract python script from Python Add-In Wizard //// extraer el script de python del Asistente para complementos de Python

527
6
Jump to solution
12-20-2021 02:59 AM
JavierCMartínezPrieto
Occasional Contributor

good morning/afternoon/evening,

I am using an AddIn created (not by me) for ArcMap, using the Python Add-In Wizard, and I would like to be able to extract the Python scripts it contains to update it so that it works in the new versions of ArcMap (it is old and the cursors it uses are obsolete).

Does anyone know how to extract those scripts.

Greetings Javier
P.S: I only have the AddIn, not the original folder where it was created.

########################ESPAÑOL##################################################

buenos días/tardes/noches,

estoy utilizando un AddIn creado (no por mi) para ArcMap, utilizando el Python Add-In Wizard, y me gustaría poder extraer los script de Python que contiene para actualizarlo y que así funcione en las nuevas versiones de ArcMap (es antiguo y los cursores que utiliza se han quedado obsoletos).

Alguien sabe como se pueden extraer esos scripts.

Saludos Javier
P.D: solo tengo el AddIn, no la carpeta original donde se creo

Javier C. Martinez Prieto
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
JeffK
by MVP Regular Contributor
MVP Regular Contributor

You could maybe see the script in the geoprocessing results list, but that is a strong maybe.  Another strong maybe is using visual studio and dotPeek ReShaper to disassemble/ recompile the addin.

https://www.jetbrains.com/decompiler/

View solution in original post

6 Replies
JeffK
by MVP Regular Contributor
MVP Regular Contributor

You could maybe see the script in the geoprocessing results list, but that is a strong maybe.  Another strong maybe is using visual studio and dotPeek ReShaper to disassemble/ recompile the addin.

https://www.jetbrains.com/decompiler/

JavierCMartínezPrieto
Occasional Contributor

thank you!!!!

Javier C. Martinez Prieto
0 Kudos
Luke_Pinner
MVP Regular Contributor

.esriaddin files are just zip archives.

To make changes, just unzip (you may need to rename from .esriaddin to .zip depending on your zip software), edit your files and then zip up again (renaming from .zip to .esriaddin if required).  When you zip up again, if your zip software extracted to a new folder, zip everything in the folder, not the folder itself. 

0 Kudos
JavierCMartínezPrieto
Occasional Contributor

I'm sorry but I don't understand this solution.
When I unzip the files, either with winrar or 7zip the result is the same, I get the information that the person who made the Add-In next to the images, the files contained in the install folder are 3 .dll and a .pdb but can not be read, I tried to open with sublime text, visual studios, notepad, etc..
I did not create the Add_in so the original folder where the Python scripts were, I do not have it, my intention is to extract that code from the Add-In itself.

 

Javier C. Martinez Prieto
0 Kudos
Luke_Pinner
MVP Regular Contributor

You can't extract any python scripts from this addin because you don't have a python addin, you have a compiled .NET addin. As the addin wasn't written in python, there are no python scripts to extract.

Bascially there's nothing you can do other than getting hold of the .NET source code from whoever wrote it (or  trying to decompile which is not guaranteed to give you usable code), editing the .NET code and then trying to recompile.

JavierCMartínezPrieto
Occasional Contributor

perfect, that's what I'm trying to get through JetBrains and as you say there is nothing in python, everything is in C++.

thanks for the answers.

greetings javier

Javier C. Martinez Prieto
0 Kudos