Getting Started with the ArcGIS Pro SDK. for .NET

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to you all my name is Rob Burke I'll be your instructor for the workshop here today we're here to look at the ArcGIS pro SDK for dotnet and get started with doing some programming with it in order to present the material I'm using a story map over here and this is the URL to get to the story map also if you've got one of these little snippets of paper the URL and my email address are here also what exactly is a story map it really doesn't have anything to do with us I just I'm using it for my delivery technique instead of using PowerPoint or some other technique so this is the like this URL will get you to everything that I'm gonna be using in the class and the URL will be up and available here it's just part of the title so as I like move through here you'll see the URL right up here anytime you want to get to this site you can either grab a sheet of paper up here or you'll see it here well this workshop is a little bit different than some of the other workshops maybe that you've been to here at the developer summit it's mainly a hands-on workshop so you're gonna be doing some of the work here and not me talking to you the whole time so I'll I'll do a couple of demos to get us going on a couple of the sections but for the most part you're going to be doing some hands-on activities hands-on work to try some of this stuff out so my goal is if you haven't used Pro to do any customization work or extending work by the time we're done here hopefully you'll have a really good sense of what you can do and you'll have practice in a lot of the different like main development patterns and get to know those patterns I'm an instructor at ESRI I work in the Redlands office and teach many of the programming and the arcgis enterprise portal server and some of the basic training classes that ESRI offers as far as our agenda goes we're here from 9 9 until 3:30 and I've split up the time into four sections so these are the four main topics that we're gonna cover here and I've tried to organize them based on the regular sessions and their break times so that we can do a little bit of work and then when the break time comes along you can take a break but if you want to keep working at the break time you can do that also so when we get started here I'm gonna give a little bit of an introduction to add-ins and configurations and then I have some hands-on lessons for you that are prepared and script it out and then I'm gonna turn it over to you to try out making an add-in and making a solution configuration at ten o'clock there's a regularly scheduled break time so you can take a bit of a break or keep working and then at 10:30 I'm gonna give a little bit of a description do some demos on States and conditions and events and hooking and then I've got another set of hands on for you to try out if one or more of these sound interesting to you as we talk about them you can try one of them or all of them or however you want to do it we have our lunchtime there's a lunch break 11:30 to 1 but you're welcome to stay here and keep working or grab lunch and come back and keep experimenting I've got a lot of hands-on that you could try out so there's shouldn't be any downtime if you're looking for what to do next I've tried to put these lessons in a particular order so that as you get started you want to learn about the basics of making an add-in and a configuration but then you've got to figure out some of the wiring stuff like what are the conditions and events and how do you work with those and then after lunch we'll come back and talk about the threading model people talk about pro being multi-threaded and 64-bit and how do we on the programming side how do we deal with that threading model we have to learn about what a cute task is what a task is and what just the basics of the threading model for arcgis pro and how we work with it you'll have to work with this within the restrictions or restraints or the basic parts of the threading model and about two o'clock there's another break time so we'll you know finish up there at 2:30 and then we'll move on to the last lesson where we'll look at connecting to projects interacting with the data inside of a project connecting to a portal and then doing things like creating a new feature class in a geodatabase or getting a feature class and adding it to a map and from there we've got some more hands-on lessons for you to work on till the end of the day how's that sound sounds okay all right I see some thumbs up in the back alright and then I'll be here of course the whole time facilitating the whole event but every once in a while in and out we'll get some of the developers from the pro arcgis probe sdk team that'll be coming in and out throughout the day so eventually I don't know when they're gonna come in and out but they've told me that they'll be here like around our exercise times so that if there's any questions that come up I'll work on answering them to best of my ability but there so the experts in their particular areas so they'll be in and out to observe and answer questions also if you've just come in this is the URL that I'm going to be using here and I'll it's I'll leave that right up at the top of the the lesson here alright so as we continue through here you might want to prepare your computer I don't know if all of you have or not but in order to work through the hands-on lessons you'll need to have visual studio of course and Pro installed with Visual Studio I'm just using the Community Edition so if you don't have Visual Studio through the links here you can just click on the links and it'll take you to the Visual Studio setup and whoops there you go so I've got all the links set up for installing and setting up Pro and the licensing of pro if you don't have Pro you can even get a trial version of ArcGIS pro a free 21 day trial if you don't have a copy and then in the course we'll probably be using the samples the community samples and the data that goes with them if you want to download the community samples there's a link right here that'll take you to the page where or it'll take you to a description of how to download the community samples so there's the web page to go to click on community samples click the green download I've got all the instructions here to do that downloading right there and LinkedIn link to you if you have questions about pro and the terminology I've linked over to the terminology guide so that anytime you have a question about a keyword or some object that we're not familiar with we can look at the at the terminology guide at any time if you have questions please say something there's not that many of you out there so you could raise your hand if you want or just speak up and say something and that'd be great anybody have any questions so far all right I'm working off of this idea here about how you retain information so in the workshop here I'm hoping to get you over to the left side here where yes I'll show you some things you'll see me do a couple of demos and you'll hear me talking about it but I want you to be doing these things and trying them out so that you'll have a better retention of what you learn here so that's what we're going for in this workshop is giving you the hands-on experience so that you know you have these guided lessons that you can work through and ask questions along the way and hopefully you'll take some of those with you and remember what you've what you've done here and be able to put it to use right away all right so our first lesson here we're gonna look at getting started with creating an add-in and creating a solution configuration the link I've got in here you should always get started with the the landing page go to the pro sdk landing page and this is a page that i have linked all the time because i'm always going to the landing page because I need help looking up something in the API or maybe I need to look at one of the samples because I know there's some good code over there that I want to copy and paste and and make use of it and for myself and then also here's the the documentation so of course this is one of the main pages you should have ready to go and at any type of when you have a question usually you can go through here and find it in the API or find some documentation about the topic or maybe even find a community sample right below there we have these they call them dev labs and these are like short 15 minutes hands-on kind of lessons that you could do on your own so there's a building an add in building a configuration building an identify tool constructing features and preparing data for use offline you might take a look at these if they're of interest to you you might try them out while you're here or try them out when you get back home next week or next month give them a try there's some concepts here the key concepts so if you're getting ready to work in a new area of the API that you haven't used before like the utility network is fairly new you want to read up on the topic and then explore the samples and find out if there's any document extra documentation that you might want to be aware of alright so coming back to our course page here I'm about ready to start doing some demonstrations but after the demonstrations I have some hands-on exercises set up for you so these are just PDF files and so I'll be doing some demonstrations here to create an add-in and a configuration and then I'm gonna have you all give it a try on your own so as you're getting ready or I'll come back to that part all right so let's let's get started here I want to go ahead and start up a configuration so with a configure a solution configuration oh you get your own splash screen you design that splash screen and then with a configuration you also get the startup page when Pro starts up there's always the splash screen and there's a start page and on the start page your user is either opening an existing project or they're creating a new project with a solution configuration you can customize the way ArcGIS Pro starts up so instead of having the regular splash screen and the regular start page you can make your own so here this is a really custom start page where our user doesn't have the chance to open a new project but they can click on this map and find projects that are already there based on geographies based on counties so if I go to San Diego over here Pro opens up it opens that project and when it opens the project you could see up at the top that there's some customization that's happened so the tabs are gone most of the regular Pro tabs are gone a couple of weeks ago I was working in Iowa with the d-o-t office over there and they wanted to customize their startup and they wanted a couple of things they were interested in doing were car crash analysis and monitoring their snowplows they have their their snow plows are they all have those GPS things on them so the snow plows are all live and they also have a video camera so when they go to the snowplows they can bring up a map they can see the snowplows driving around they can click on one on the map and they can see a video a live video from the snowplow to see if it's snowing or not or what's going on over there anyway with a solution configuration you get to decide what tab should appear in pro you can keep any of the existing tabs but you could remove them and put your tabs up there and then the other thing with pro is add-ins an add-in delivers some extra functionality so here I've got an add-in that delivers a whole bunch of buttons over here I've got seven buttons in here but so we're talking about two patterns of customization or extending arcgis pro add-ins are a way for you to deliver functionality like buttons and tools and extra tabs solution configurations are a little bit more encompassing where they're helping you to get the project open to the user and decide what functionality that user needs so a solution configuration is a little bit more than an add-in it could contain add-ins and extra functionality but it also helps you to customize the startup of how Pro shows its startup page and what it looks like when it opens to the user part of that startup process is also determining the user who is the user and what portal are they connected into are they connected into ArcGIS online or their own organizations portal and from there in the configuration you could find out what portal they're connected to and what groups they belong to and maybe you have a full customization of the startup per person or per group that they belong to so if you have different groups in the organization Pro could look different to one group than it does to another group because you can find out who's logged in and then based on that information you could decide what tabs that person needs based on the group they belong to so we have to customization patterns that we've been looking at here add-ins and solution configurations and what I want to do now is let's go ahead and build both of these I'll do the add-ins first and then solution configurations after that and then we'll have some hands-on time where you can try it out also so here I am I've got Visual Studio going and I'm going to create a new project when I go about creating the new project I can see that okay I'm under visual studio and ArcGIS and I've got the ArcGIS Pro add-ins templates here there's a template to create add-ins and a template to create solution configurations oh let me go ahead and I'm gonna start by making an add-in all right as Visual Studio gets going it's going to generate a project for me that is set up to build an add-in so it's going to have lots of folders and references and files created one of the files that gets created is a demo file damn ol is for the desktop application markup language it's like Ezra's version of XML or zamel if you're the in the WPF programming so that's all it is the damn old describes what the user interface of pro should look like based on your add-in so here I'm getting ready to build an add-in and when I look at the damn ol there's some description down here to describe given this add-in that I'm about to build what controls does it contain well I don't have any yet what tabs does it have and then per tab what groups are available per tab and then within the group are there any buttons that are tools or controls that should appear in that group so here I'm inside of a module and with an add-in you can deliver functionality but you could also update or change functionality or you could remove it so I'm in a module here called the insert module that means I'm going to be inserting new functionality with the update module that could be that oh I want to update one of the existing tabs and I want to put my button on an existing tab so I could use update module to change some of the existing tabs and groups and organize them and then there's delete module which I could use to remove a tab or remove a button that I don't want my users to see well for now I'm building an add-in and I want to add a button my add-in is going to contain a button so I'm coming here over to the project and just like you would add other items into the project I'm going to add a new item here okay so right click add item and you'll see that we have more templates in here for each of the different kinds of controls that you can add so if we look through the list you'll see things like buttons and dock panes and galleries and down at the bottom there's tools so there are various controls that you can add to prou your add-in can contain one or more of these controls so you could have many buttons or a mixture of buttons and tools and dock panes that your add-in delivers well I'm gonna create a button and I'm gonna just go ahead with all the defaults here after I create the new button you can see that it's created let me come over here into the project it's created the buttons c-sharp file and when we look in there there's the click event it's all stubbed out and ready to go and ready for me to add some code in here I'm gonna leave it empty to start off with and look at the let's take a look back at the damn ol and see how it's changed a little bit earlier there was no button now I've got a new button in here there's some elements in here that are describing the button and its caption and the button is part of a group so oops so my button over here has been added to this group the group has a name and right now the group is going to be added to a tab called add in the name of the tab is add in and this new button is going to appear on the add in tab I'm going to go ahead and start Pro and let's take a look at let's take a look at what this add-in delivers to Pro all right as Pro starts up I'm gonna open up a project here as I get my project open you can see there's a tab called add in and when I have a look at the add in tab you'll see my seven buttons from before but then you'll see my new button added in over here I don't have any code behind this button so it doesn't really do anything when I click on it but yeah now I could go ahead and write some code to run when somebody clicks on this button you might notice I have a Palm Springs tab over here what's over there Oh you can add tabs without doing any programming so a user could go to the project backstage area they could go to the options area and they can customize the ribbon and then here in the customize the ribbon area well they could make a new tab and then after they make the new tab they could come over here to look for commands to add to that tab so here a regular old user could build their own tabs and organize a series of buttons and tools that they use often like a they could make a favorites tab without doing much programming at all but just organizing buttons and tools that are already there all right let me come back here I'm gonna go ahead and let's come back to the code here I'm gonna make just a quick change so instead of having my button appear on the add in tab I'm gonna make my own tab so here I'll make a new tab let's see here I'm not very creative so I'm just gonna call it Rob's tab all right and then I'm gonna change the group and I'm gonna change the name or the caption on the button alright let's see what I did here so I've taken the tab here that was commented out and I've opened it up I've given it a caption I've changed the caption here of the group I need to delete this line so that my button will now appear on its own tab so here I'm using the desktop application markup language to make my own tab make a group and then place my button into that group alright let's go ahead and start up Pro again and let's see what see what the user interface looks like now before I had the Palm Springs tab I had the add in tab and now there's an extra one Robb's tab over here and when I come up to my tab you can see that oh yeah there's my button add points and it belongs to the editing group so on the dam aside you're customizing the user interface and designing the user interface and then there's the programming side to write the code that goes with that control now I'm going back to the backstage area and I'm going to the add-in manager here in the add-in manager you can see the add-ins that I've been building this is the one that I've been working on today this is the one from yesterday that has those six buttons in it let's say I wanted to get rid of the one with six buttons in it I could delete the add and there's a delete over here however when Pro starts up it looks for those add-ins so if I delete this add-in and get rid of it and then go back go back over here to the add-in tab the buttons are still there I need to restart I need to do a restart Pro so that it rereads and looks for any add-ins to to add into pro before I do that we need to come back here to the add-in manager when Pro starts up it looks into your User Profile location so here it's going to my user profile under documents ArcGIS add-ins and Pro and it's looking for any add-in files that are there any add-ins in this folder will be used to extend pro pro reads those add-ins and then builds its user interface from there so if I go to that folder go to the C Drive go to the users and my own user profile and my documents and ArcGIS add-ins here we are you can see that I've got one add-in over there now because remember I deleted the add-in that I worked on yesterday so now if I start up a fresh Pro I should see just this one add-in Pro is looking to this User Profile location any add-ins in there it brings in so here is Pro opens up you can see my extra tab up here you can see the add-in tab is still there but the first the six buttons are gone so my first add-in is now gone when you look at my tab I've got my button here when you look at the add-in tab anybody know why the add-in why my button is still on the add-in tab what did I forget to do I forgot to delete this line of code so my button appears on the add in tab but it's also going to appear on the robbed tab too I need to keep forgetting to delete this line here all right the other point I wanted to make about add-ins and then we'll look at configurations is that with add-ins they're delivered to pro as it starts up so pro looks in your user profile folder it can also look to other folders too so here in the add-in manager you can set up folders where pro should go to look for other add-in files it could look over the network somewhere you could have a network share and have everybody point to that network share and then when everybody starts up pro their pro will look in into that network share location for any add-ins and then bring them in to pro all right I'm gonna stop Visual Studio here for now actually I'll leave that one going I'm gonna start up a fresh Visual Studio and now we'll look at configurations to see how they're a little bit different so I'll follow the same pattern of creating a new project but this time instead of creating an add in when I get to the templates up here I'm going to create a configuration all right and then as I follow through here the project gets generated in the project I can see that oh yeah there's some similarities here there's a demo file there's a module here there's an extra configuration manager that's been created though and there's an extra folder the UI folder with configurations you have control over the splash screen and the startup page and you can add information into the about page the way that you do that is by working on these WPF controls so the splash screen if I go to the sample splash screen that you get to get started here there isn't much to it it's just a white banner with some text on it but yeah then you'd go in here and change this the graphics here to make them more customization to you or to the organization that you're developing for using their branding of colors and logos and and that sort of thing you could design their splash screen to be very customized and then the start page it's also a WPF control let me just build here so we can get the start page up so you get a default start page that in this case helps your user select a project or browse to browse to find a project this is just a WPF control so over on the left side in the toolbox you could use any of the common WPF controls and you could drag them and drop them and design your own startup page so you're gonna start a page here to get going but more than likely you're probably going to fully customize the way the start page looks these are WPF controls so instead of Dan'l they have the Microsoft sam'l behind them the XML over here where you design what the user control looks like what the WPF control looks like on the about page you can write in a little bit of information here that will get inserted into the ArcGIS pro about page let's see here all right whoops okay so here I could put a little just a quick change here to the UI of the about page let me do the same on the splash screen so we get a little customization here to look at when I get the configuration going splash screen okay okay let's see so we've gone over this okay oh and then I want to take you into the configuration manager in the configuration manager there are several overrides the overrides tell pro to use your startup page or your splash screen or your about page so there's kind of a two part here you go about designing those other pages but then you have to do an override so that within this configuration Pro knows oh okay you want to override the start page okay let's use your start page or you want to use your splash screen okay well come on in here to override the splash screen and point to your splash screen instead of ezra's splash screen the overrides here are optional so you can pick and choose which of these you would like to override you don't have to override them all maybe if you're fine with a regular Pro splash screen you can just leave that you don't have to take over the splash screen you decide what overrides are best for you a couple of the things you might want to override could be the application name so you instead of seeing something like ArcGIS pro you might have a special name for your app over here you might want to use you or your image or your the organization's image or logo of some kind as the image that appears in the pro upper left corner alright let me go ahead and start up the configuration and we'll see that pro is now going to have my splash screen and after the splash screen it's going to have my startup page well not mine but the one that comes as the default start page and then I could pick a project or I can browse for one and open up that project within this solution configuration I haven't taken over the tabs up here so with my configuration I haven't overridden that aspect of the the solution configuration but that would be the next step for me to take over and control what tabs appear to the user Oh howdy where does the configuration go like with add-ins the add-in goes to my user profile folder with configurations they don't go to the user profile they go to the public profile let me navigate over here into the public profile alright so here under the public profile you'll find that I've made a couple of configurations here over the last couple of days but let's see here's the one that I was just working on here Honus Pro know which configuration to use when it starts up well I'm gonna grab my configuration here by name copy that you might have noticed when I first started Pro earlier today when it started up with the custom splash screen and the custom start page with the California map I actually clicked on this icon here on this desktop shortcut so it's actually through the desktop shortcut that you get the configuration started so let me right click here on the shortcut and you'll see that we've added something instead of just Pro exe in the shortcut we've got a slash config and then the name of the configuration that we would like Pro to open with so I just created my Palm Springs configuration I'm gonna change the name here to that configuration and apply it and click OK and then now when I start up Pro from this desktop icon it's my Palm Springs solution configuration that starts up and then here you can see the custom title and there's a custom logo over in the upper left corner there if I go to the backstage area you can see my about information has been added and integrated in with pro regular about page alright so for now I want to have you try these things out yourselves so what we're set up for here let me bring up the website here whoops there we go we are right in here on lesson one and within lesson one there's three exercises for you to try out these are three hands-on activities the first one is to create an add-in the second one is to create a configuration and then the third one is to do a customized do a customization of the solution configuration using that manager class so that you'll take over and do some of those overrides in the excerpt the third exercise the challenge part here is go to the community samples if you have time try out one or more of the community samples each of these links should take you to a PDF file and then in the PDF file there are some loosely written instructions of how to create an add-in and how to create a solution configuration and then how to customize that configuration so for now I'm going to turn things over to you all to try out some of these hands-on hands-on parts it's about 9 42 and according to our schedule we have until about 10:30 before the next lesson starts so you've got about 45 minutes to try out some of these hands-on lessons here for lesson 1 to get started if you haven't linked already to this page where I've got all the hands-on exercises linked to here this is the URL that you'll connect to unless you've got my fortune cookie fortune you'll have the link right there on the so I'll kind of be walking around the room if you have any questions at any time just call me over if some of you are just coming in we are I'm using this URL here for my app that has all of our all the topics that are covered here today if you're new you might want to get one of the fortune cookie fortunes here Wolf's got some up in the back there or you can just type in this URL ArcGIS alright so the workshop here is for those of you that have been here we are working on just getting started with pro and the SDK and according to our agenda we've finished up with the first lesson here we've looked at add-ins and configurations and the next part is to look at states and conditions delegates and doc panes and events and hooking seems like a lot to cover I've got just lessons that you can work on to cover each of these I don't know that I'm going to talk about each one of them but I'll get to them as I can and then after lunch we're going to cover threading and then after that we'll cover projects and geodatabases and adding layers to maps and that sort of thing when you get to the website here you'll find how to prepare your machine if you haven't done so already I know some of you were working on these parts over the last a little bit of time and so we've covered lesson one we've looked at creating add-ins and solution configurations did anybody get to one see did anybody make customized their customized the configuration okay a couple of you made it okay well they're here so at any time if you want to try these out they're available and go ahead and give it a shot all right so our next topic here I want to look at states and conditions let me close a couple of these windows here okay and I'm just on one of the pro guides here so in the SDK I just did a search for states and conditions and we're looking at coding your own states and conditions before we do that let me bring up pro here and take a look and see if see what we can find here for states and conditions before we do any anything special okay so if I look up here at the Clear button it's grayed out right now because I don't have any feature selected on the map so the Clear button is checking for a condition and a state and if it if it doesn't find the right one then it turns itself off automatically or if the condition changes its going to turn itself back on again so as soon as I make a selection well all of a sudden the Clear button is turned on another place where states and conditions come into play if I'm looking at the UI here I can see the standard tabs these are three tabs that I added during my demos but right now I don't see anything extra over here however if I click on feature layer over in the contents pane then all of a sudden I see some extra tabs coming up so when the conditions are right these extra tabs will show up when you have a feature layer selected these are the tabs that go along with a feature layer if I select the map those tabs disappear if I select the base map I don't get as many extra tabs over here these context-sensitive tabs but based on what you're doing in the contents pane or in other panes there might be buttons and tools and tabs that are appearing or disappearing or enabling or disabling in the directions here to go about creating your own state or condition what you're gonna do is work in the demo and in the code-behind so in the dam all you've got a little bit of work to add a condition to your your project through the dam hole but then you've got to have a little bit of code you got to have some kind of a method or property out there that's gonna toggle the state so that when the state changes anyone subscribing to that state through a condition will have some effect they're either going to gray out or appear or disappear or become active so we've got three steps define a condition have some code for the state so here it says based on a state or a combination of states so there's a condition that's going to rely on one or more states a state is checked on or examined in your code so you'll have kind of an if-then statement that's okay if it's one condition or one set of properties then the state should be true otherwise it should be false so this is code that you're gonna have to write this is the first part here is just in the dam mole the second part down are the third part is in the dam mole because you'll make a UI element like a button or a tab and then you'll on those buttons and tabs there are conditions there's a condition attribute so you could set the condition equal to a condition that you create your condition will check on one or more states it might be that you write the code for the state or arcgis pro has maybe a few hundred states and conditions that are already programmed so instead of you having to start from scratch if you just want the same behavior that the the Clear button has you could just borrow its condition what condition does the Clear button use to turn itself on and off we could find out and then you wouldn't have to do any programming at all so first off I would look to the existing states and conditions that are predefined and then once I find those decide can I can I just use one that's already been coded and if so let me go ahead and use that otherwise then you got to write your own code to check on whatever attributes or properties that would be correct for your button or tab to make its appearance in the demo earlier we talked about the modules and that there's the insert update and delete modules another area of the demo at that same level would be conditions so this is where you could insert your own condition where you've looked at the states and condition that are part of our GIS pro and you couldn't find one that you needed to use you need to have some specialty checking done so you would insert your own condition you give it an ID and for your condition your condition is going to check on some state now this is where we need to go to the code and we need to write some code to toggle this guy here true or false all right along those same lines while you're still in the demo when you want your condition to be checked does it need to be checked right away as Pro is getting started so here this note says okay in your insert module make sure the auto load is set to true so you'd have to add the auto load prop or the auto load attribute here and then your condition will be evaluated when Pro starts up so that means if your button needs to test should it be grayed out right away or not if you want it to have that check right away when Pro starts you got to add this attribute all right now how do we toggle this state back and forth that's where you'd go about writing a method and inside there you would probably have some more some more checking going on in here and your business logic to figure out what what conditions are right for the button to be on and then what conditions are right for the button to be turned off so here you would create some kind of a method that changes the state from true to false or activate to deactivate the third part is pretty easy the third part is linking the condition to your UI element so here if we have a button defined in the damn ol coming on through here there's a condition attribute that you set so here on your control you would set the condition attribute equal to you could put in your condition here or you could put in one of the existing arcgis Pro conditions that would mean you would have no other coding to do you could just find the condition that goes with clear or there's a condition that checks to make sure that a map is active that a lair a feature layer is selected you could find those conditions and just use those here and then you wouldn't have to do those earlier parts of making your own condition just use one that's already there I do hear oh there it is okay all right so I'm just gonna take a look in here one of the conditions is ESRI mapping map pain and this condition checks to see that a map is active so I'm gonna borrow this condition here whoops let me copy that oh there's a link in here to all of these conditions so there's a huge listing here of conditions that are already available to you the listing is huge as you can see I would want to look through here to make sure I would want to look to see if there's a condition that already covers what I need it to do so I don't have to write the code so let's say that I do I have a button and it has to work with a map and if there's any other anything else any other pains that are open right I don't want to use those other pains all right so I've grabbed I've grabbed a condition here that checks to see if a map pain is active and I'm gonna come back over to my code from earlier today so here's where I created a button at points all right so in this button I'm going to add that condition oh whoops could you have multiple states and then and and/or the states yes you could and you'll you'll do that in the exercise part in the hands-on part but yeah up above here when you insert when you insert the condition you can define multiple states and then use and plus or or any mixture of those that you need you can get as complex as you like all right so let me I got to grab that line here I thought I copied this but let me grab it again all right and then I'm coming over here to my button and I'm trying to paste in here okay that looks pretty good so now I've just added this condition to my button I'm gonna go ahead and give this a test run and see what it looks like when Pro starts up all right so I'm opening up my project and as I look at my tab here my button is available there's a map pane that's active what if I go over the catalog window and now look at how my button is grayed out so right there I've set a condition my button is always looking for that condition to be right when I go to the map my button automatically becomes alive and ready to use so that's an example of using an existing condition what if there was a what if I want to make my own condition that's when you add like right up in here where we had modules in your insert module you can add conditions using the damn ole and then here I'm adding a condition I'm giving it a name and it's gonna be looking for this particular state so for this condition let me I've got auto load here set to false so it's not going to check my condition on startup I would change this to true if I wanted the condition checked on startup but for the example state I've got our now write some code that figures out what what is this state and when should it be activated or deactivated so that's when I'd have to go into the code and I've got a method over here called toggle state and this method it's main job is check that to see if this current state is there and then depending upon what that condition is decide when to deactivate it or when to activate it in here you'd probably have more business logic making these decisions or maybe it's just a one-liner just to check a certain status of something and then activate or deactivate so you got to have a method a little bit of a block of code over here that takes the whatever you want to call your state we just called it example state you could call it whatever you want and we're just toggling that either making it active or D active all right and then the third part back in the demo is go to your control and over here in the control we're actually calling on that toggle so we're describing the project telling it to go over to the module that's in the project so the syntax here has a couple of parts to it it has the name of the project for the first part of the syntax an underscore and then the name of the module where you're storing the method here toggle state you can call the method whatever you want we called it toggle state so now for this button whenever it needs to check on that condition it always knows okay there's a class out there it is it's over in the module and the name of that method is toggle state you could have you could put it in your own module if you weren't putting it in the like the project over here has a designated module and that's where our toggle state method is located all right so with this one I've got my own code to toggle the state of the condition and let's see what happens here Oh I wanted to look up a little bit yeah so here whoops it's my tabs so I've obviously opened up a different project and what I've got in this project are a couple of extra tabs and these tabs have a condition set for them they have my condition so they've got this example state condition which I defined up above so the two tabs both of them are checking to see what the condition is and then they're going to decide whether to appear or not and it's my button the clicking of the button that's changing the state so let's see here I've got Pro going oops that is not the right I thought I started pro oh there it is I'm looking in the wrong place here okay let me get pro going here get my project open all right so the button that I was just showing you is called toggle state and when I click on this button it's the one that's actually changing the state over there so instead of having some business logic it's just the clicking of this button that's changing the state and then those two tabs are there like listening for that condition to change so keep your eyes over here on the right side I don't have any tabs over there but when I do the toggle then the two extra tabs show up and then those tabs have buttons and tools located on them if I want to get rid of those tabs well then behind the scenes the state changes right now my button is taking care of that and that's when they disappear this is the same kind of action that's associated with the feature layer when you click on the feature layer you get extra tabs when you click on a different layer or the map those tabs might disappear all right if I look back at the code here oh let me get pro back up here and I wanted to show those tabs because something is interesting is happening oh darn I closed the I closed that map didn't I or was it the one on the I got too many Maps open there we go sorry about that so here as I toggle the state the two tabs show up but then when I go to the tabs look at how they have some ESRI controls on them as I look at the various tabs I could have my buttons and tools here but I've decided to show some of the ESRI controls on these tabs what I wanted to show is in the demo how do we make that happen so here we're we're defining those groups well I could place my button into those groups but here I've used sre buttons and tools I found out what they're ref ideas and then added them into those groups so when you're building a tab and you're putting together the groups that are going to be on that tab you might be putting your controls into those groups but you can also put the ESRI controls into those groups you need to know their names though you need to know the names of the controls to get those names I like to just do the easiest possible for me if you hover in the tooltip that comes up right at the bottom you'll see the name of the control or the the ref ID at the bottom I don't think I can zoom in here oh and then I did the that didn't mean to click on it okay so that's one way to get to the ref IDs if you don't see these IDs it might be because you don't have them turned on in the options customize the ribbon I've got my show command IDs and the screen tips turned on if this is off of course you're not gonna see the ref IDs coming up then it might be confusing for regular users to see those IDs coming up they might not know what to do with them so most of the time you might leave this off but it's a quick way to find those IDs another way to find them let me come back to visual studio and stop stop debugging another way to get a listing of all of those damn o IDs all of those IDs is on your project you can right click and there's this option here Pro generate damn all IDs this will generate a huge c-sharp file that will have all of the dama IDs listed in it so let me do that it doesn't take very long so here the C sharp file got created and then if I open it up you'll see that well there's a ton of them in here so every single one of the IDs is listed in here now so this is yet another way you can get to the damn ol IDs we could go into the SDK and there's a whole listing there also where you can look up the damn ol IDs yes yes you could look up the conditions for the clear button itself how would you do that I don't know if I want to tell you that no I'm just kidding let's see so great question let's take a look here we're looking at the Clear button and let's say I want I want to find out what conditions the Clear button uses or what states it uses because maybe I want to do the same thing so what we could do here and I've got these directions written out so your question is really a good lead-in to the the hands-on part determining you know so this is just the answer to your question here determine the conditions used by any Pro command so for this one I've got a warning in here that I kind of made a little bit of a joke that I didn't want to tell you but I do want to make make it clear that I would I put up some warning flags here but this is one way you can look up so here we could go to the it is it is but as long as you're asking I'm okay showing it so here if we go to where the software is installed in the bin this is a really good point for me to bring up so we can take a look in there and then it'll show it'll answer the other question about using and' and or' so here i'm gonna go to this folder here i'm gonna go one level up copy and paste here whoops I thought I copied in Oh what is it doing there it's not giving you the whole thing okay so I'll just navigate over there alright let me go to the C Drive and program files over to ArcGIS we're gonna go to Pro and the bin and the extensions and I want to go to the mapping all right and one of the things you'll see here what I like to bring this up because take a look at each of these folders here let me zoom in and ignore that it uses the word extension here it's almost as if each one of these is its own little mini add-in so when I go to any of these folders and I open it up you could even tell by their naming that there are logical groups of functionality so let me go to mapping and in here you'll see some of the dll's your add-ins have dll's there's also some XML and there's also the dam all the dam all contains the user interface description so here this is the dam oh that goes along with the mapping functionality for pro oops I meant to let me cancel that I meant to right-click it and open it with notepad so here we're kind of looking under the hood now and this is the dam Oh for all the mapping functionality and if we look at it we'll see okay hold on now let me scroll down a little bit I've got some stuff going on here that I'm just gonna bypass for now okay and we get down to the modules area and then here's the insert module and here we can find all the all the functions all the tabs that are mapping related and how they get inserted so this is really the description for the pro UI of lots of the mapping functionality alright I'm just gonna do a ctrl F I'm gonna look up conditions all right so here we can see there's a tab that as a remapping table tab and it has a certain condition well as we keep scrolling through here I could keep finding conditions there's probably too many of them to search on but here's the conditions area so in the listing here would be all of the conditions and we could see that okay here's a condition about subtypes it has a state it's using not as opposed to and and or if I scroll down in here we'll start to see some that might use a combination of and and not so here's one that happens to use some knots and an and and if I scroll down a little bit further we'll start to see just a variety of conditions that are checking on States and then combining and Ana war and not to check on those states let's see so if I wanted the selection button I'm gonna do an alt F here let me get my fine back that's remapping okay so here I'm finding the clear selection button looks like it's part of a group let me find the next occurrence okay okay got it so here's the clear selection button and it looks like one of the conditions that checks for is is the map pane active this may not be exactly the same clear select that I'm thinking about let's see here let me try one more Oh what happened to my clear selection okay got a typo in here clear clear selection okay so I could keep going through here and find there might be several buttons that had the same keyword inside there so I might have to keep looking through here to find the exact button and the exact condition that I want to check for but once I find that condition if I'm making my own controls I could use that reuse that condition I want to make sure not to save or change this file at all because if I do the mapping functionality might get messed up in Pro are they read-only I had not checked but I don't want to change them no matter what so I want to get out of there okay so for now it looks like we're just after 11 o'clock here we are in lesson two and what I'd like to do is send you off to try some of these exercises here they're not very long but the first one does the state and condition the mapping then you grab one of the existing tools or buttons and find its condition and we go a little bit further in here I don't have enough time to talk about some of these things but a delegate command means let's say you make your own doc pane let me do that here let me go ahead and let me go to visual studio I'm gonna just go to my states and conditions here and what do I have in here right now do I have I don't have a doc pane let me insert a doc pane so here I'm gonna do an add new item and go to the ArcGIS items in here and just like I've added new buttons I'm gonna add a new doc pane when I add a doc pane a couple of things happened over here in the in the project I got a little bit more than I bargained for so part of the doc pain I got the zamel that goes along with it because it's a user control a WPF control and then I've got its c-sharp file behind the scenes so we've got we're using a certain style of Microsoft programming the MVVM pattern so sometimes they call it the model view viewmodel technique and with dock panes this is a great example of when the MVVM pattern is just used we don't really say anyway we're you want to use mvvm or not we just go ahead and use it where you get a user control that's the viewing part that's the user interface part and then you get the view model that's where your business logic goes that's where your code goes and over here model is optional in the pattern but model would help us to get to data in a database or a JSON or XML or wherever you might have data stored you would use the model to make those connections so we've separated the three pieces the user interface the data and the business logic and we're just following that pattern so here the doc pane has this component here the XM zamel component and if we take a look at it it's just a WPF control that you can add more controls on to right now it's empty but I could grab a button over here and I can grab a maybe a textbox and a label and so I would get to design this WPF control this is going to be my doc Poe in the dock pane I might ask my user for some information like a user name and password or I might let the user set some properties up here there might be some buttons that the user clicks on to make something happen or maybe the button is really a tool so when the user clicks it they have to go over to the map and they have to draw something over here on the map you can design your own doc pane from the ground up and aside what what information do you need to get from your user and what controls do they need to operate on maybe there's some data that you're showing them in here and it's reading and writing a database somewhere or an XML or JSON somewhere else so you're giving your user of U on that data so now what if you wanted to call here what if you wanted to call one of the essary controls you could very you could go to this button and like double click on it to get to its code behind and go to its click event and then you could write your own logic in here for the clicking of the button however you could also call on some of the ESRI controls so if you wanted to do maybe the add layer or we could look at the pro UI here and decide well maybe there's some buttons that you want to add you don't want to add this button to your pant your pain you just want that functionality so when we talk about delegates let me come to our course materials here when we talk about a delegate command and implementing a delegate let's see here oh okay oh I think I I used the wrong term here I'm sorry how did I get that mixed up delegate and the hooking so the hooking part means you could hook in a pro command so that when I click one of those WPF buttons it hooks in one of the commands from ArcGIS and lets me use one of those one of those commands the command could be a button or it could be a tool so as your user is working along by the way the contents over here this is a pane and the catalog window is a pane so what I'm talking about doc panes it's one of these that you could design your own doc pane and within that doc pane you get to decide what it looks like and what functionality it has it could have all of your own functionality but potentially like if you want to get your user to draw on the map you might find out well what tool can I use to make that happen maybe the Select tool maybe you want your user to be able to select without having to come up here to hit the Select tool and then come over to the map and do the selection potentially you could have your own WPF control that does select and it hooks in the pro select button so when your user clicks here and they come over to the map they're just using the select button alright so for now I'm gonna send you off to work on these exercises here it's about 115 we've got till I don't know when lunch starts it might start at about 15 minutes but you could work for a little while then take lunch and then maybe come back from the lunch and keep working and then at let's check our timing here at 1 o'clock we'll start up on the threading and asynchronous programming and using queue tasks alright so for now you've got some time to work on the lesson two exercises here all right I'm gonna turn my microphone off and as we did last time just call call us over if you have any questions we're getting ready to look at pros threading model to figure out how does this threading system work well the good news is a lot of stuff is going to happen behind the scenes so you're not gonna have to do a lot of thread management but you'll have to follow a pattern so that your code runs where it's supposed to run so there's a little bit of thread management but once you see the pattern and you'll constantly follow the same pattern so it won't be a different pattern each time but there's a threading pattern to follow where we use Zuri's cued tasks all right so we got to figure out what this threading means I've got a little bit of description here with some graphics and we hear how arcgis pro is different than desktop because oh it's multi-threaded what does that mean multi-threaded well with pro there's there are several processes that can run simultaneously or asynchronously but when they run we have to make sure that they don't lock up the user interface so in my graphic here let me zoom in a little bit what my graphic here is representing this is like the main user interface thread sometimes we call it the main UI thread so as you're writing some code I think we've been using the main UI thread so far we haven't gone to any background threads yet one of the goals with Pro is that it doesn't lock you user from doing anything your user should have a responsive interface the whole time with arcmap sometimes you'll run a tool or you'll do something with arcmap and then it Gray's out and you'll get arcmap unresponsive or you'll get some message where you can't do anything the the UI and arcmap Gray's out a little bit and you can't click any buttons you can't interact with the map with pro you should be able to continuously interact with the product so the app needs to remain responsive on the programming side then when you write the code for your business logic you'll need to run your code in a background thread so your code can't run on the main UI it has to run in a background on a background thread in the threading system there's a couple of terms I'm going to throw out here so I think I've got them written down but I'll write them down again so there's the the main UI thread that's where the user interface things are going on windows are opening and a user might be clicking a button and those things can happen on the main UI because they don't lock it however if you want to run something like a buffer or a union or some process that's going to take a while that process needs to run on a background thread we have a term for that we call it the MCT or the main sim thread and sim is for CI m for cartographic Information model so this is something that's been created by ESRI to handle the background processing to handle the threading so when you see when we write the code we're not really going to have to be thinking about well how many threads do I have and how are those threads being managed and we just won't have to deal with that so it's handled behind the scenes through the main cartographic information model thread and this has been built for us so that we don't have to worry about managing all the threads that might be happening behind the scenes so if I do a buffer the buffer tool can go off and run and do its work and yeah it's gonna come back with a result sooner or later but I could also do some other tool like a select and then it could go off and do its work both of those processes will run in the background on the main sim thread they're gonna run asynchronously so the process gets sent off our user can continue acting acting interacting with the user interface and they don't have to wait for the buffer to finish or for the Selective finish the user can stay over here and they're zooming and panning and maybe they're clicking on some other buttons over here and they have that responsiveness they're not stalled in any way good question so what if I do a buffer and the buffer goes off to run and I want to do a select but it needs the buffer so how do I control the threading how do I like if I just call buffer it's gonna go off and run and if my next line of code does a select it's gonna go and run and it might not have the result that it needs to finish so I could either have a failure or some unexpected results part of this model and actually coming from the Microsoft side to there's a way for us to tell this process to run and wait so our code is almost paused here the the you eye isn't paused but our code is paused so it's gonna wait for the result to come back and then it'll go on to do the next operation so that's a programming technique that you would have to follow you'd have to know which ones to wait for and then decide oh yeah I do want to wait for this one you don't have to wait every time but you can ask it to wait you might think waiting is going to lock your user interface up but the waiting doesn't it just holds your code up to wait for the response to come back all right so then we get into some of this terminology that sometimes they call them coarse-grained methods or fine-grained methods there's two kinds of methods and if it's coarse-grained it's an asynchronous method if it's fine-grained then it's a synchronous method the way that you tell the difference between the two when you're looking in the help system and you look up a class and you find out what kind of methods it has the asynchronous ones will have async appended on their name the ones that don't have a sync are not coarse-grained they're fine-grained methods and they're gonna run synchronously so let's I'm gonna jump over to the help system here I don't know if I have the SDK page linked here but I'll get to it there we go SDK let's just take a look at the API and look at some classes and their properties and methods all right so I'm gonna go to the API the map class seems to be a real popular one so I'm just gonna search through the API here what happened all right I got the API I want to do a search oh it's just a little slow for me right now it's spinning away all right so I'm going to search for the map class and over on the right side I can see a couple of results coming back that use the keyword map and luckily the map class came up pretty high so here I'm gonna go to the map class and as I look at the map class I can see the map has a lot of connected connected items here that I could also examine maps have a spatial reference they have some geographic and projected coordinate system associated with them but I'm looking for the methods so I'm going to scroll down a little bit I'm gonna scroll down a lot and I'm gonna look for the map members down here at the bottom so that'll take me to the maps properties and methods alright and then here are the public methods for the map class and as we look at them do you see any that are asynchronous okay so one of them is asynchronous the others are not so this is gonna help us to distinguish what pattern to follow is the method asynchronous that means it's automatic it's already designed to run in the background so with this one get Z from surface async I could run this one right in my regular code I don't have to do anything special to run this operation it's gonna just run asynchronously and it's gonna go to the background by itself we don't need to do anything however with these others they don't have the async keyword so we would call these synchronous methods or you might call them fine-grained methods most of the methods fall into this category so every once in a while you're gonna come across some asynchronous methods all the rest are gonna be synchronous well let's focus here on a synchronous method all right I'm gonna grab just a block of code here with a synchronous method in it already defined wait a minute did it I surely can't grab this code very easily is it gonna okay let me come on over here let me go to what do I have here I've got a I'm gonna create a new button so let me go ahead and start there I'm gonna add a new button to this project okay and then in the click event of this button I'm gonna add oh gosh that didn't come in very nicely I'm gonna add this bit of asynchronous code in here boy that doesn't look good it's probably where it'll work okay why did it do that my I guess they have carriage returns in that PDF file so here I'm using geoprocessing and I'm using the execute tool async method so with this method you can run any of the tools in the toolbox how many tools are there in the toolbox lots of them anybody throw out a number 850 something like that I don't know exactly but there's there's a lot of tools in the toolbox so within your code if you want to run any one of those tools this is the method to use it's an asynchronous method so select by select layer by attribute tool is going to run in the background automatically and here I'm doing this select layer by attribute I'm telling it go to the parcels layer make a new selection and then use this sequel query here this where clause and find this address for me all right so let's run the code and just see what happens all right we'll get Pro started here well that's good I'm gonna go to a different location okay okay keep that out to the side here okay I'm gonna go ahead and open this project there's a map in here that has Portland Oregon parcels for some reason my pro has slowed up a bit alright so here I'm gonna go ahead and zoom in a little bit on the map maybe I'll change the color here so it's not too purple okay alright and then now I'm gonna go ahead and run that tool or that sorry that button oh boy where'd my button go well that certainly isn't it okay I'm in the map I'm in the add-in tab I don't see the button that I just created maybe it's failing because of my code here alright hold on now let's see where is that button here's button button one it's right there let me take a look at the damn all and the config damn oh and let's see where button number one is here Oh oh gosh oh brother where'd it go wait a minute do I have I don't have no okay I saw myself add that button in there and here's the code for the button anybody see if I did anything strange or besides how the code came in here all right let me scrap this one then okay I'm gonna quickly throw together a second okay let's see here this I was using this one earlier this is my configuration let me get rid of that all right I'm just gonna throw everything out and start from scratch sorry about that I'm not sure what happened with my button I thought I added it to the project it might be in there but I'm just too nervous and don't want to goof around and look for it so I'll just create a new add in all right as I create the new add in I'll add a button I'll put my code back in there click on the project add item add a new item add a new button I see the button in there I'm gonna go to the demo and I see the button in here button one it's going into Group one I'm alright let's go to the code I'm gonna go to a different place now to grab my code instead of from the PDF file I'm not copying very well from there so I'm gonna grab it from here I've got a extra word document on the side ok go to the coarse grained here we go ok all right I got the code here alright I think I'm back on track again this will look a little bit better so it's on the geoprocessing object asynchronously run select by layer select layer by attribute I've got to resolve geoprocessing it shows up as red so I need a using statement and when I do the drop down here we can see that ok arcgis desktop core geoprocessing has the geoprocessing class in it so i'll resolve it that using statement will get added in up here and we're ready to go alright let's cross our fingers and hope this one works I have a layer called parcels and it's from Portland Oregon and it just has parcels in it so in the code here let me zoom back in here here there's got to be a parcels layer on the map and that's what I'm using as a starting-point parcels alright so let me get my map open back up here okay not sure why my pro is going a little slower alright yeah so here I'm over at Portland Oregon they've got parcels of land over here here's my button over here button one is now showing up I'll click on button one and it selected this parcel of land over here let me clear that let me do a clear go back to the add-in I'm gonna click and then zoom in right away oh it went too fast I was going to try to zoom in and the map while the tool was running but it goes too fast now all right so I've run an asynchronous method and the thing here is I didn't have to do anything special like I talked about this special pattern of programming when you have methods that are already asynchronous you're good to go you don't have to do anything special just call on them and they're automatically gonna run in the background now the next question that came up was hey wait a minute what if I put another method in there like here I'm going to add zoom to selected async so select the feature on the map and then zoom in on it I'm gonna resolve map view and get its using statement in there and this is where we're gonna get something weird because this tool is gonna run asynchronously on its own thread but then I'm calling this method it's also asynchronous it's going to run on its own thread the two threads are separate they don't know about each other so when I run let me run the project again here just so that we can confirm the behavior when Pro when I run the tool or it's it's not going to be able to do both of these things okay all right so here I'm gonna go ahead and click on the tool sorry a button and you can see that the parcel was selected but the zoom the zoom went off and ran and finished before the selection was made so there was nothing to zoom in on what if I click the button again what's going to happen it'll do the zoom because now there's something selected so it will select again but zoom will see that oh this one's selected I'm going to zoom in on it so it now seems in well that's not good behavior we're one step behind there so what I need to do now is take advantage of waiting and to do that we're gonna use a Microsoft technique so I'm going to add a couple of keywords in here okay and I'll zoom in here so you can see what I just did I added a sink and a weight so this is following a Microsoft pattern and part of the pattern is using this async keyword in the click event by doing that we're saying okay within here I might be calling on some asynchronous processes and I need to wait for some of them to finish so there's a corresponding keyword a wait and now here we're saying go ahead and run this tool but pause here wait till the tool finishes then go on and do the next asynchronous process all right so now oh there's the green underline let me zoom in here the green underline is telling us I don't know if you'll be able to see the message here can i zoom in I can so here it says this call is not awaited so we're seeing green it's not red it's not blue it's green so it's it's more of a hey are you sure you want to do this it's expecting us to also use the await keyword here too but does it make sense to await here there's nothing else after it yeah so why should we wait we don't need to wait because there's nothing but if there were more lines of code here probably you might want to await it it's up to you though if you want to use a weight or not the Green is just a warning saying it's there use it if you need to alright so now we're running again here and this time when I use the button it should do both of these in sequence so it'll it'll do the query and make the selection on one thread and wait till that's finished and then zoom runs on its own thread all right so here I'm gonna go ahead to the add in and click on the button I'm just clicking off to the side here so you can see that I'm still using the user interface over here even though all those asynchronous calls were happening so the user interface is always responsive even though we're running some other methods and but they're running asynchronously they're running on their own threads and I haven't really had to do anything to manage them yet it's pretty pretty straightforward all right so now this is where it gets interesting when we are when I was showing you the help system there are more synchronous methods most of the methods are synchronous and for those we're going to have to follow a slightly different pattern because we need our code to run in the background so we're gonna have to make our own asynchronous method do you do that for those are cob jex programmers out there do you make your own functions or your own you don't make your own functions or your your own methods your own nope you just write your arc objects code and you you call on it you never thought about packaging up a balk of code and then calling that code when you need it [Music] okay okay yeah like your own functions and classes okay okay okay so that's what we're gonna do here we're gonna write our own methods our own functions our own methods and then after writing those methods then call on those methods so first of all let's we'll just kind of ease into it without it's optional you don't have to write your own method but it could be to your advantage to write your own methods let me cancel out here and I'm gonna grab a little bit of code here off to the side I need just a little bit of code here all right so I want to grab a different block of code all right and then what I'm gonna do here is I'm going to I'm gonna delete all the code that I had that had the asynchronous methods in it okay all right I got to do a little bit of using a couple of using statements are needed here good okay let me zoom in so you can see what I'm doing here so I've switched over I'm now going to use the Select method and the zoom to selected method these are they don't have a sink in them they don't have the keyword in there so these are synchronous methods I'm really doing the same thing I'm using the same query I'm finding the parcel layer so I've got the same layer same parcels layer I'm building a query filter and then doing a select with the new selection expo as opposed to add to or remove from all right so now let's let's see what happens here what if I try to run this code what do you think is going to happen if I try to run the code any thoughts ok good ok let me try to run it let's see what happens so we get a failure we get an error message and it tells us we're running this thing on the wrong thread so when I write the code in this way there's no asynchronous processing at all it thinks that I want to try to run this code on the main UI thread I'm not allowed to do that and that's what it's telling me here that I need to make a thread and put this code out on its own thread ok and I want to you might have seen me bringing up the help in the background here when you look in the help system so here I'm looking at all the methods on the map class and if I look just a little bit on all their descriptions it says oh gosh you got to call these on the main sim thread you can't call them for the the UI thread they're not going to work so that's the error message is backing this up the error messages would be nice if it says hey why don't you just use queue tasks and that'll help you out but as you look here all of these they're all synchronous methods and they all need to run in the background in order to do that we have to create something called a queued task so that's what I'm gonna do next all right I'm gonna grab a little bit of code in the background here ok copy that and bring it right on in here I need to get just a little bit more here to finish off that task and then I'll explain it all right so what did I do here that in there just kind of clean things up a little bit oh yes okay all right I'm gonna go to queued task and make sure that I'm getting it from the right the right place resolve it okay notice my line is turning green because I have a sink so I can I can await this if I need to that'll get rid of all that green stuff oops I thought I resolved queued tasks what am I missing oh I'm missing a return down here okay was that did I miss that you think I had something else in place there okay all right let me know I'm not gonna worry about that right now but here cute ask oh that looks okay cute ass comes from ESRI but it's based on Microsoft's they call it the tap model it's a task based programming technique so with tasks with a cube task queued task is going to take all of the code here and run it in the background so it's going to take care of that background processing for us any code you write that has synchronous methods in it like these two they need to be run within a queue task so that's what the error message was saying you're eight you're running this on the wrong thread you need to run it using cued tasks if you have synchronous methods they need to be packaged in a cute task so that they can run in the background they need to run in the background and not on the main UI thread okay that symbol means it's kind of like an anonymous function it's like hey this is my function here and I want to call this function I want this code to run in the background so the lambda helps us to organize the the code into like an anonymous function so that it that symbol on it on its own thread it could be if you have asynchronous methods inside there which which would be kind of weird to have an asynchronous method calling on other asynchronous methods that's probably not a good style it's possible but not the best programming style right yes you have to run it in the background you have to run it on its own thread this is the pattern we follow to run code on its own thread that might be bad also yes I'm gonna let me just bring up an example here here we go let me go to my threading model picture so yeah so here we're basing our work off of the Microsoft task pattern which is this task based asynchronous programming so Microsoft they have something over here it's called system dot task and our the esri queue task is built off of microsoft's system dot task so it's really following the same idea but the whole point of it is making it easy for us to do the multi-threading the second part of that is if you make an add-in and somebody else makes an add-in and I make an add-in and another person gets all three of our add-ins on the same machine well if we've done our programming right all of us are making threads and we're not going to bump into each other and have trouble those threads are managed even though one user might be pulling in lots of add-ins from different resources and using that variety of add-ins so by following the multi-threaded pattern that guarantees that none of us will lock up the user interface we all have to follow the same pattern everybody that makes an add-in has to use queue task to call on their synchronous methods oh so now to the question here about let me just add to my diagram here I'm gonna put another one of these over here a smaller one alright so that's the main UI okay one and two and m3 so earlier I was showing you a couple of asynchronous calls where I did a I did a select and then I did a zoom and I could go on to do something else after that but what's happening here is for the main UI we're calling off and starting up a thread and doing processing on that thread then we come back to the main UI then we go back to make another thread to run in the background come back to the main UI then go make another thread and run in the background and then come back to the main UI that back and forth takes a little bit of time to make those threads and manage them and get the results back so with cued tasks let me just do this I don't want to confuse it but I'm just gonna abbreviate here QT for Q tasks and with a Q task we can organize the methods that are going to run and use synchronous methods so here we're just going off into the background once and we can have all of our methods run one thread and then come back with the results so it's a little bit more efficient to organize your work using queued tasks and the synchronous methods and just have one that does everything in the background on one thread and then comes back with the final result so this back and forth here you can have too much of that and too many threads they're all different threads that would get created and managed and there's a bit of overhead associated with that that's one of the reasons why most of the methods are synchronous they are that way so that you can carry this type of action out so you can follow this pattern of making your own Q tasks using as many methods as you need to and putting them all on to one thread and having them run together okay so you're asking about the methods and how most of them are synchronous but some of them are not so that's a great question oh I've already got those removed so some of the methods are asynchronous for convenience so the esri developers that we're building all the methods somehow they got together and decided oh you know what this would probably be better as an asynchronous method why don't I just package it up and make an asynchronous method out of it and then in other cases they have pairs where there's a synchronous and an asynchronous they've got the same name but one of them runs synchronously and one has the async suffix on it and it runs in the background without you having to do any cute tasks so the esri developers that built the API they've put the methods together for you and you're gonna see those methods most of them synchronous and with most of them you'll have to build your own queued tasks I just need a minute here today I have that in there feels like I'm missing something now that's Microsoft okay just need to check my code here what did I have something else at the end did I pick the wrong tasks hmm okay I'm doing something wrong here but I'm not sure what I'm trying to resolve cute asked and it looks like it resolved alright if I can't figure it out I'm just gonna go on to the next bit here you cold okay wrap it in the cube task got it did I add in or delete something here okay I'm not sure what I've got incorrect here sometimes I'll have an extra or a missing closing or curly bracket or something I can't tell okay fine great okay now I want to package this up okay here we go all right so what I'm gonna do next let me come back to the the code here and take a look here all right so when you build a cued task the code in the queue task is gonna run in the background you don't have to worry about the threading it's automatically happening because you're using cued tasks an interesting pattern though instead of just building the queued task over here in the click event more more commonly what I might do is build some functions there was something okay something weird is happening here why is that still red oh maybe because I got the a sink in here like that I don't hey I wanted to get rid of all the code inside the click event I thought it got rid of it all but it's like still remembering cute ask thank you yes I wonder if that would have helped me earlier you did okay all right so I've clean let me do a build all right I'm doing the bill then it doesn't seem to throw anything all right let's see what happens here I'll just keep going all right so what I'm gonna do here is I'm gonna make my own asynchronous method so I'm gonna go here you could make a new module or you might make several modules and within those modules you might have several asynchronous methods that you create yourself and then you can call on those when you need them when you build your own asynchronous method you're gonna have all the queued task stuff inside there but you'll have a name for your method so you could call it you could pass values into it and so it could return values back out of that method so it's like building a function or a collection of functions that you could call on anytime you need them so here I'm just going to go into the module I'm gonna grab a little bit of code that I've got here behind the scenes and let's see if this helps here so I'm gonna copy this in and just coming over to the module I'm gonna paste in a new a new new method over here you could call this method anything you want it's recommended that you put the async keyword at the end so that you know for sure this is an asynchronous method so here I'm just building my own asynchronous method it's based on Microsoft's tasks from system dot tasks so it's going to return tasks all right so now here in the queued tasks let me see if I can finally get this to resolve okay and let me grab another bit of code here all right I've got a return in here so that might be that might be helpful all right I got a little resolving to do let me get that done query filter all right so now I've got my own method inside the method I've got a queue task in the queue task there's the lambda here or anonymous function that's going to run and inside here I'm doing a select and zoom to select it there these are synchronous methods they don't have the async keyword okay oh now I need a way for this method to run so I'm gonna come on back to my button to its click event and let me add a couple of lines in here to call on my method all right let me copy that and let's see if this works here all right so what I'm hoping to do here is call on my asynchronous method it's over in module 1 I want to await it so I'll need to have the async keyword up here all right I'll need to resolve the message box I'll just use the system windows message box all right so when I call on my function it's gonna run asynchronously because it's using cued tasks it'll do its work it's gonna come back with a count so that I can find out how many items were selected and then I just have a message box that pops up that information I don't know if this is gonna work right away but I'm gonna give it a shot and see if it works all right up getting my demo project open probably time for me to make a new project I think this one's got too much stuff in it all right there's Portland here's the button crossing my fingers zoom to the selected feature and then I get a count telling me how many features got selected so when we started I ran the selection and the zoom with asynchronous methods those two asynchronous methods it just so happens they have corresponding synchronous versions of themselves it was more efficient for me to call the synchronous version but I had to wrap them in queued tasks and then if you're using queued tasks it's to your advantage to build your own asynchronous functions to build a collection of these functions so that you could call on them anytime you need them so here from the button I'm calling my own asynchronous function or asynchronous method so while you're oh go ahead so here I'm building a cute ask the functions got to return something and up above here I'm saying that I'm gonna return an integer out of this task so it tells us that okay return count yes I was missing the count I was missing the return count and that might have been it I was just running cute ass go by itself I was not returning the results of the cute ask yes copy let's see if I can replace this here [Music] there it finally resolved so this should work - exactly okay hold on a moment let me let's make sure that this does run so it it should come up with the same results I would think except instead of running it instead of making an official asynchronous method out of it I'm just running queue tasks in the click event alright so there's the ad in queue task is running inside the click event but it is because it's an acute task it's going off onto that background making a thread and doing its work in the background but it's to your advantage to build these asynchronous functions instead of just putting cute-ass blocks okay all right and then the green stuff because I'm using async up here it's telling me with the green that if you want to you can await you can wait for this one to run you don't have to await it but it's your advantage to await all right yes make asynchronous functions for yourself they need to be asynchronous because they need to run in the background so make your own functions wrap the code in a queue task so that they do run in the background on their own thread and then it's a cute task that makes that thread that takes them into the background and manages the thread that they're gonna run on all right so for now we've got some hands-on time here in the hands-on time that the hands-on part kind of goes along with my demo here so you can try out making a coarse grain method making a fine running a fine grain method and then making your own asynchronous utility method the last part here I just threw it in there we really haven't seen any VB I don't know if any of you or anybody using VB couple so if you want to look at the VB version it's it's here very similar on the VB or the C sharp side but somebody asked me a while ago how do you do it in VB and all this is just looking at the two compared I think I just used the telluric utility to convert one from the other and so the VB is up on the top and the C sharp is down on the bottom but the the async is a little bit different in VB you figured yes it mixes me up too yeah I'm with you yeah like how many methods are in our Cobb jex like 10,000 or something like that 30 thought yeah just but could you do the threading in our Cobb jex could you make your own threads it's not multi-threaded yeah I don't know if that was an easy process alright so we'll take some what's that easy as this yeah how easy could it be I wanted to get started just by looking at Pro and getting an idea of what some of the pieces look like on the pro side before we start talking about them on the programming side so our the first set of components to start talking about is in the catalog window when you look in the catalog window you can see that oh yeah I can connect to my project and then what are these things here what would you call these things in the in there are they tabs folders that you can expand folders they look like folders it's like a tree view kind of a thing okay we call them items so just to keep it simple at the top level they're called project items so a project is composed of items and some projects might have more or less of these items depending upon what you're building but whatever you make a project you always get a toolbox in a geodatabase to go with it unless you've changed your basic settings you can go to the backstage and go to the options and you can turn some of these on and off so that you don't always get a geodatabase or always a toolbox but yeah that's the out-of-the-box setting you get these project items and if you build geocoding locators you might get the locators item you might like right now I don't have any layouts so I don't have the layout project item and I don't have any layouts here in this project so on the user side user might go and insert a layout and pick from one of the page sizes and then over in the project there's now a layout item a project item that's stores the layouts or keeps track of the layouts some of the things you might do here would be get an existing map and and open that map or you might be creating new maps with your code or new layouts with your code so on the programming side we start with the project and there's sort of a hierarchy where you can go to a project get to the project items find an item and one of the different collections and then do something like get the map item and then put it in put the map into a pane over here or sorry into a view so here there's a map view I've got a layout view it looks like I've got two map views because I have the same map displayed twice here I'll close up one of those all right another area that you might be interested in connecting to is a portal so when a user goes to portal here they have selected over here their content so the user would be able to see content as there logged into their own portal this would be their content stored at that portal location so this is all my content here if I belong to groups then I go to the next one and I could find out what groups I belong to so here you can see all of the groups I'm part of I could go into any of these and see if there are any items inside there that I might want to open up and work with on the programming side you might want to find out what groups I belong to and then if appropriate open up a map that is part of one of these groups or show me controls that I can use to do things to maps in one of these groups based on my group membership the open cloud over here is just any any content stored at ArcGIS online so if I did a search here for National Weather Service NEXRAD I'm just looking up for some weather data all right so I get a whole bunch of choices here these are all shared by who-knows-who at ArcGIS online some of them might be official organizations that are sharing their work I'd want to look into that before using their data but yeah so here I'm finding some weather data I like this one here the WMS it's from National Weather Service and it's hosted by Iowa State University oh one of the things that I wanted to show just about Pro is if you're looking in the contents and you see some data that you'd like to add to a map you can always right click and you can add it to the current map you can add it to a new map or to a new scene so this is kind of a nice shortcut where instead of me having to go to insert and pick new map and make the map and then add the layer and just right-click on the layer and add it to a brand new map and it does all that for me right away and then we can check the weather and see how it's going on the East Coast over there all right so for now we've looked at the project and that the project is made up of items and your user is always connected to a portal and we can find out who they are what groups they belong to and then we can have our code react based on some of that information or we could just go to the portal and look for some data that's there and add it to the map maybe you create some services that you put out there you find your services and then add them to the map okay the other what else I want to do I want to map a folder connection here or to my C Drive all right I want to go to our sample data for the community samples this is the one I was pointing to earlier that you could go to the elections data so this is this folder here is what you download for the community samples data and I'm just going into the US here in the States so a couple other things you may want to do are to interact with a geo database so you may want to get to a geo database you might want to do something to a feature class inside of a geo database you might want to add it to the map you might want your user to edit that feature class so you might create a tool and then your user might digitize or edit or do something to that data so from the project we can do a little bit of navigation or if you knew where the database was stored we could connect to the database get a feature class and add it to a map or the other way around what if you didn't have any data to start with you could write a little bit of code that makes a geo database that makes a feature class that adds some fields to the feature class and then adds it to the map so that's the other piece we're going to be looking at is how to interact with data inside of a geo database either getting data that's already there or creating new data what do you do now to make a new feature class how do you make a new feature class okay so from the user standpoint right click and then there's a new and new feature class would be a way to do it what happens when I click here what is what has just happened I got to a geoprocessing tool so there's the create feature class tool from the toolbox how do you run this same thing in your code what what method do you use geoprocessing the object and then what method what was that yes yes execute tool async so within your code if you want to create a new feature class you'll run execute tool async and you'll pass in this tool and all of its parameters that's how you go about making a new feature class if you were gonna be doing things to this feature class like adding fields well if I go to the toolbox there's a tool called add field so again you could do another execute tool async and call add field and pass in the parameters to add a new field all right the last thing well not the last thing but I want to show something with tools so I'm gonna come to my Visual Studio project here and in the last lesson part I made a couple of buttons here I'm gonna change gears and create a new tool so just like you make a button you go to the project and right click and add new item in the list down near the bottom one of the items that you can add is a map tool with a map tool I'm gonna get my user to do some drawing on the on the map so I'll go ahead and add that tool alright the tool just got added into the project I want to look at the damn ole first so you can see what what got added in here for the dam apart not that much so in the demo we get a tool the tool has a caption I'm gonna change the name of my tool here I'm gonna call it draw polygon alright and then now let's take a look at the c-sharp code that got generated for this class alright and as we look at the code here it's not a click event right because you don't click on the tool you might activate it so yeah as the user clicks it the tool becomes active you could have some code run when the tool becomes active what we really want is this one here with a tool your user is going to draw some geometry whatever they draw goes into this variable so inside this method on sketch complete async you get their geometry you could do something with it what would you do with geometry that your user has sketched up for you okay so make features out of it what else buffer use it in a tool all right we might use it in a buffer we might use it in a select select what is this select select by spatial the spatial selection select by location so okay make features in a geo database use the geometry to buffer to select to feed in somewhere to a tool okay draw a graphic so lots of things you could do with the geometry after the user creates it you get to decide that's where you become creative and decide what happens you might make some kind of a special editing tool so as users looking at a feature on the map maybe they do something to that feature with a tool and it cuts the line into two parts or does something special so yeah your tool could have extra special functionality to it besides just creating new data or drawing or using it in another another tool you might actually be doing something special to the geometry oh I forgot the top part here this the tool gets initialized we have a couple of parameters up here the main one is right here the geometry type what is it that you want your user to draw are they just going to be putting a point or a line or a polygon or a square rectangle right now the default is set to rectangle that might be good if they're making a box and they want to select things that are inside that box but let's take a look at the other options here of what can you do with the tool what can you draw with that tool there's a variety of curves and ellipse angled rectangle a circle if we look through here you'll see the basics point line and polygon you could do the lasso and that's where the user doesn't have to click but they're just kind of moving around on the map and doing like a freehand well I called my that I go I gave my tool a name draw a polygon so that's what I want to put in here for the the geometry I want to sketch out a polygon o capital P all right well I don't have a lot of code here but we're still going to be able to see the behavior so let me go ahead and start this up and we'll get a look at what the tool is doing so far all right when I go to the add-in here's my new tool over here caption is draw a polygon so my user grabs the tool they come over to the map and they can click and draw a polygon when they're finished they give a double click and they're finished they're done with the polygon and then I get the geometry in my code so I can decide what to do with this polygon maybe I use it to make a selection well since I don't have anything going on in the finished sketch well it just disappears so I can see I'm drawing in the polygon when I finish it though I don't really do anything with it I don't have any code yet to do something but I really want to take this polygon and draw it use it in another operation or add it to a geodatabase all right we'll take a look at a little bit of code here for working with a project so let's leave tool here for now and I'm gonna come back over to the sample here let's look at project alright so how do you do this in our cobb jex there are a couple of those classes that it's like the classes there to begin with you don't need to make a variable for it you can get to the what do you have the map document and a couple others so here project is like that where a project is always there you can write code to get the current project and then do something with the current project maybe get it's here we're just getting its name nothing special and its path if you wanted to create a new project on project there's a create a sync method so with this one it needs to have some project settings so here we're going about creating some new project settings the name the path and if we're in this case I'm calling on the map template and using the map template you might have your own templates so when you start up Pro there's that list of four templates scene and globe and map you could potentially be making your own templates so that when Pro opens up it has certain maps in it already and you do that as part of designing a template so here you could open up one of the ESRI templates or if you've made your own you could create a project using your own template I talked about the project items one of the items inside of a project are the folder connection project items if you want to if you want to create any new items we have several factories there are factories like a map factory a layout Factory so you would use the factory to create new instances of math or layout or in this case just a folder connection up above here I've set up a couple of folder connections to my student folder and demo data folder and then in acute tasks I'm using the to create methods over here these are synchronous methods and creating new folder connections on the user side we call them folder connections on the programming side those are project items they're folder connection project items where we could have map project items or layout project items and create them using their the appropriate factory all right last bit of code here on projects and continuing on the idea with factories here I'm using the map Factory and creating a new map and I give the map a name and the type the viewing mode would be map or could be a globe or could be a scene and then you have the option also to put a base map in there too so here I'm creating a map I happen to be calling it Hawaii when I use the map Factory to create a map it's gonna add it to the map project item and we could see it inside there but it doesn't automatically open it up and display it to the user to do that I've got an extra method here create map pane it's an asynchronous method so this one takes the map and opens it up so that it has a tab and that your user can start interacting with the map the last bit that we're doing here is setting up an envelope just a rectangle because we want it's it's full extent when you click on the full extent button we want it to be zoom to Hawaii so your user might be interacting with the data and when they click zoom to full extent it doesn't go out to the whole world but for this map the full extent will be Hawaii this will be one of the ones you try out in the exercise the exercise part all right on the portal side let's see here I don't know if I want to go into this one right now what are we gonna do here okay I'm gonna hold off on this one for now and let's take a look at geodatabase creating a geodatabase earlier I was talking to you about creating geodatabase feature classes and how normally you would just right-click and make a new feature class with what really happens though is you you're calling a tool so I would do the same thing then if I was going to be making a feature class let's see here let me cue this up again here alright so here we talked about using execute tool async and just call it on the crate feature class tool from the management toolbox when you create a feature class though you have all those parameters and we need to have a way to pass in those parameters one of the ways to do that is with something called a value array the array contains the parameter name and the value that you want stored for the parameter so if I back up a little bit here to make this feature class that's not the feature class that looks like a field up there to make the feature class we have to describe what database it's gonna go into we have to give the feature class a name and decide whether its point line or polygon yeah I don't know if the others here are all that important but then we need a parameter for the spatial reference what coordinate system will be will we be using will it be a geographic coordinate system or projected coordinate system do you all have a coordinate system that you use most of the time what's your preferred coordinate system 4326 wgs84 4326 if you're from out of town maybe a different one out of the country okay good that you got it memorized any other ones these 34:19 what is that it's eastern Kansas okay any others you guys are easy what coordinate system is pro use so here I'm just opening up Pro there's gonna be a base map in there right when you create a new map what coordinate system is that what quartet systems is ArcGIS online in Google and Bing Maps yes web Mercator so if we go to the map and we look at its properties and look at the coordinate system its oh I've kind of veered away when you create a feature class you have to define its coordinate system and then I was kind of asking well what coordinate systems does everybody use and the common one is wgs84 but if you're in a certain locale like Kansas or Britain you might have a different [Music] yeah I haven't added any layers yet to the map so this one is the what is this layer a base map why is it there like when you're at arcmap you don't get layers do you yeah you got a ready-to-use base map right there okay yeah an arcmap you I want to see the map right away when I open the product I gotta see a map okay so the yeah when you make a new map you get a base map and the base maps all use the web Mercator auxilary sphere coordinate system what happens when I add a layer to the map does it keep that coordinate system let's see I've got the Iowa counties so my Iowa counties use a different coordinate system they use a different geographic coordinate system instead of wgs84 they use North American datum of 83 for their geographic coordinate system why am I getting this warning okay yeah wants to transform my data from this coordinate system over to wgs84 and it's telling me is it okay if I use this math formula for you if I click OK here well then it should just add well it's already added the data to the map but it might meets a little bit of adjustment using this formula here in the drop down I see lots of others I could eliminate some right away because we're not in Alaska so those could go the software does a little bit of geometry checking on your data and it tries to build this list thinking that okay you're in Iowa probably you're gonna use this transformation here would be most common and then going down the line these might be the next most common transformations you might have to try a couple of them it looks like some of them are I don't know why it brought up the 27s here but I could eliminate those probably don't know I might try a couple just to make sure that I'm getting one that fits the best but usually it's gonna try to do the best it can and figure out what would be the best one so now is my map still in the web Mercator or did my base map change okay so hold on when we first looked this was web Mercator the map because my base map is web Mercator but now I've put in the nad83 data so I'm wondering did this change up here or is this is my map still a web Mercator so the counties we think are now being transformed and projected into web Mercator that's what should we think should be going on let's take a look so the map actually changed we didn't expect that but the map changed to match Iowa to match its coordinate system the first layer that you add to the map will change the coordinate system my other data the base map is still in the wgs84 web Mercator auxilary sphere coordinate system because it's a base map and just like arcmap when you add a layer to arcmap do it the data frame changes yes okay so now this is what we've got to end up with the map changed to match the layer that I added the base map is still web Mercator but it is being changed its coordinate and you can tell there's something strange because the names look at the like in the background some of the names are kind of stretched out now because the base map is being projected into the new coordinate system so it might not look as crisp as it did before as they start zooming in on some of the cities it it might lose a little crispness because of the projection especially as we go to the north you can't even read you can't even read the names of the places up in the north all right so back to our back to our tool as you're picking your coordinate systems you also want to be aware of how adding a layer to your map might affect the map based on its coordinate system all right for the most part though most organizations you all have an established coordinate system that you probably use most of the time if if the base map is no longer appropriate because it's being projected you may not use the base map from ESRI or you might create your own base map all right I guess that's enough for now we only have about ten minutes left here I'm gonna hang out if you want to try out an exercise or to the the webpage here I'll leave it up probably for a couple of weeks yet and yeah so if you at any time if you want to go to the hit the web site here and and look at or I think you can download these they're just PDF files so you could bring them local to yourself if you want otherwise that's going to be it for me I'll hang out here and answer questions for you as needed yes okay okay so your goal is to allow your user to find layers and add them to their map okay could they look over in here and the project could you give them a like in the folders could you connect them but currently you just have it in a like a form and you have tabs on the form and okay could you do your own pane over here like make your own pain how do they get started did they pick a folder for you would it be the same would they all be mapped to the same folder from their same drive so they'd all have like the F Drive and everybody's F Drive goes to that phone Oh UNC paths okay so you could have some code and this may not work for you but I'm just going to give you one example to start with your code could add off of folder here right in here and then they would just open that folder and it would be connected to that UNC path for them so you might have a button that they click on when they click the button then when they go look in their folders list they have an extra folder in here that you've prepared yes the configuration could automatically put it in yes the next level would be to try to recreate what you've already got and then in Visual Studio you would add in a doc pane I've already got a doc pane in here and then when you're in the doc pane come on over to the WPF controls and I've just looking here there check boxes and there are tabs so you could potentially recreate it using doc panes over here you could put tabs on there and then you could have your check boxes in there too yeah well I would like to try that sometime but it should be possible to dynamically generate the tabs why sure so that must be about what you do now you have a form and you generate the tabs for the form okay yes yes different pattern different patterns yeah try to get the users used to just use the tree over there and find their layers using the tree so you have an Excel spreadsheet and what do you want to do with the Excel spreadsheet you have IDs in the spreadsheet and you have IDs in a feature class and you want to connect them together yeah could you do a join you could add the spreadsheet to arcmap or arcmap you got to be talking about arcmap now hold on yes let me have an example right here that I could show you give me just a moment to figure out I have some data that would support that okay yeah oh okay demo data I have to figure out where my data is I think it oh it's not in there oh it might just be under as retraining Pro okay oh come on I can't find out where I can't figure out where my data is that I have it in here all right I had a spreadsheet they go with that spreadsheet in the end let's say that I had some data that goes with Iowa in a spreadsheet you would go to the feature class or first of all you would find the spreadsheet it'll show up over here in the tree view and then you would add the spreadsheet and it'll show up over here in the table of contents and then you would go to the layer and right-click on the layer and then there's the join and with join you can take the two tables and join them together if there's a common ids in both tables what was that you have an add-in to do it automatically but there's too many steps involved to add the late you're saying that this involves too many steps to add the layers and then make the join yeah with like with the join they would have to get to the add join and then it brings up this tool and then they would have to fill out like here's the layer the join table would be the Excel spreadsheet and then they would have to choose the two ID fields in both tables but you want to make that easier a one click OK yes yes a layout you want to see the layout all right yeah so on the insert tab let me zoom in here on the insert tab you can make a new layout pick a paper size so I'll choose this letter and landscape and then you get a layout that opens up you got a add the map that's because there is only one layout now you can have many layouts and then you can decide what maps to add in there but you got to add the map yourself you could write a little code to automatically put maps in there but you might have many Maps how would you know which one to put in the layout one map one layouts okay oh my gosh too many options that's good yeah and then once you make the layout on the insert menu then here you could put in the insert the North arrow in the scale bar and like the dynamic text you can add all those things onto the page you can add a graticule over here pretty easily you could what else have we got here for layout you could do a map book like we call it a map series you can make a map series so I could put each County on its own page and make a PDF file out of it okay all right so you got the add-in tab now and after class here you've got ten or fifteen different buttons how do you get rid of them go to the backstage area to the add-in manager and then you'll see all of your ad ends here you could just select them and then there's a delete in the lower right corner to delete the add-ins okay that's okay no we're talking about removing add-ins from Pro you might be talking about just removing a button or two if you just wanted to get rid of a button you could go to the dama and get rid of it there but he's talking about he's got all these add-ins and wants to get rid of all the add-ins yes yeah you got to go all the way over to the lower right corner to delete because they really want to make sure that you do want to delete it before you delete it an add-in is just a file look right in here you see the name here this is the name of the add-in I didn't give mine a very descriptive name so it's usually just Pro app module one two three unless you give it a better name I don't yeah I can't I've use bad names if I use better names than okay when you in Visual Studio when you compile the Adhan it put it into this folder here into the user profile folder if I say delete the add-in it goes to this folder and it deletes that file and that file is gone you want to keep the add-in around you just don't want pro to use it you got to put it in a different folder then so instead of deleting it here let me go to get rid of this one so here I'll go to the I'll go to this module 32 I got to remember a number over here it starts 486 are you guys up next oh boy we got to get out here okay still there okay all right thanks everybody
Info
Channel: Esri Events
Views: 7,379
Rating: 4.9069767 out of 5
Keywords: Esri, ArcGIS, GIS, Esri Events, Rob Burke, Esri Developer Summit 2018, Esri DevSummit 2018, Esri Technical Sessions, SDK, .NET, ArcGIS Pro, Microsoft Visual Studio, DAML, UI
Id: lkwpq6QuK3U
Channel Id: undefined
Length: 191min 57sec (11517 seconds)
Published: Thu May 10 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.