Saturday 16 May 2015

Arcgis SDK C#: Addin running code on arcmap startup


I know that the addins are 'lazy loading', but I want to initialize some variables on startup of arcmap. This would be loading user preference data for the workflow we have in place, updating the FC with initial data etc.



Any direction on how to do this would be great.



Answer



If you want code in an add-in like a button to be available when it is loaded rather than when it is clicked, in the Config.esriaddinx file add onDemand="false" to that button's xml.


You can also use an Extension class to execute code during its OnStartup(). Create the extension, and in the Config.esriaddinx file, add autoLoad="true" to its xml.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...