Select to view content in your preferred language

ArcGIS Add-Ins Wizard creates static classes - Really?

1985
4
10-26-2010 06:04 AM
JakubSisak
Honored Contributor
Hello folks. I am having a fairly difficult time with just completing the Add-in walkthrough using the recommended VS Express edition. This with a lot of VBA and VB6, ArcObjects experience under my belt.

Quoting from the Building custom Add-ins walkthrough:
The  ArcGIS Add-Ins Wizard creates static classes depending on the  customizations in your add-in in the config.designer.cs file. Since  you're building an ArcMap component, the add-in template generated an  ArcMap class with several static members???such as Application and  Document???for you to use.

It does not create the ArcMap class (as shown in the walktrough) when using the Express edition.

Any workaround for that?
0 Kudos
4 Replies
PhilMorefield
Frequent Contributor
Same problem here. I'm using VS2008 Standard, with SP1 for ArcGIS Desktop and the .NET SDK.
0 Kudos
JeffreyHamblin
Occasional Contributor

... config.designer.cs file. ...

It does not create the ArcMap class (as shown in the walktrough) when using the Express edition.



Since you mention a *.CS file, I will assume you are using VS C# 2008 Express. I am using the same.

If you look in the Solution Explorer for your Add-in project, you should see "Config.esriaddinx".
If you expand that entry's tree, you should find "Config.Designer.cs" under it, which contains the static classes as described.

-Jeff
0 Kudos
PhilMorefield
Frequent Contributor
Just to clarify, I'm not working C#. Just plain 'ol VB. In my case, "Config.esriaddinx" cannot be expanded. I had to modify a few things to make the walkthrough work. For example:

ZoomToActiveLayerInTOC(TryCast(ArcMap.Application.Document, IMxDocument))


should be

ZoomToActiveLayerInTOC(TryCast(My.ArcMap.Application.Document, IMxDocument))




And:

simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle


should be

simpleMarkerSymbol.Style = ESRI.ArcGIS.Display.esriSimpleMarkerStyle.esriSMSCircle



I'm very new to VB and VS2008 so I'm actually not sure about everything going on here. But it works.
0 Kudos
MartinLewis
Occasional Contributor
Ever find a solution to this?

I'm having a similar problem. 

I'm using VS2010 and the Add-in Wizard creates the static ArcMap class when using the template for creating a C# Add-in, but does not create the static ArcMap class when using the VB template.
0 Kudos