Select to view content in your preferred language

Help With Copying Code From ArcMap VBA Editor to ArcGIS Pro SDK

523
2
02-29-2024 10:24 AM
AndrewV96
Emerging Contributor

I want to copy this code for a tool that runs like a geo-processing tool for water flow.

I'm moving from ArcMap VBA Editor to Pro SDK from MS Visual Studio using ArcGIS Pro based on these ESRI articles: 

ArcGIS Desktop and VBA Moving Forward (esri.com)

Recycling VBA (esri.com)

I'm a little unsure how to do this. I have some screen shots of the code and my progress. Thank you!

AndrewV96_0-1709231003113.png

AndrewV96_1-1709231030975.png

 

 

0 Kudos
2 Replies
CarlosPiccirillo2
Emerging Contributor

I feel your pain, I am converting ArcObjects C# code to Pro SDK C# using Visual Studio. In my case, I started by creating an add-in button following this example. 

Build your first add-in | Documentation | ArcGIS Developers

Once I had the button, I added a new class in Visual Studio and copied/pasted my original code one function/method at a time into it. Since Visual Studio highlights compile conflicts for you in red, for each method/function, I looked in the ESRI github repository as well as Google searches for a Pro function that would do the same thing. Here are some examples

ProSnippets · Esri/arcgis-pro-sdk Wiki · GitHub

ArcGIS Pro SDK | Documentation

ArcGIS Pro SDK for .NET | Documentation | ArcGIS Developers

As you can imagine, this was very time consuming but after one solid month of this, I got to the point where I could run the code. I am still struggling with getting some of the stuff to work correctly but now it's just a matter of the Pro SDK learning curve. 

I hope this helps you in some small way.

Carlos

 

AndrewV96
Emerging Contributor

Thanks a lot for your help Carlos. I got a lot of errors about "Set" and "Let" not being valid. Online I see to omit it but it seems like that could cause more errors: 

AndrewV96_0-1709656317389.png

 

 

0 Kudos