Dale,Just so I am clear about what resolved your problem: All you had to do was remove the enclosing namespace that was created by the New Add-In Project wizard in the button class file?What about the following entry in your original Config.esriaddinx file: <AddIn language="CLR" library="ERMDTools.dll" namespace="ERMDTools"> Did you need to edit that as well to an empty namespace?-Jeff
<AddIn language="CLR" library="ERMDTools.dll" namespace="ERMDTools">
Imports .... Public Class btnAddHyperlink Inherits ESRI.ArcGIS.Desktop.AddIns.Button Public Sub New() End Sub Protected Overrides Sub OnClick() Dim pFeature As IFeature, pLayer As ILayer Dim pSRE As SpatialReferenceEnvironment Dim pQF As IQueryFilter
If that doesn't fix it, try starting a new test Add-In that only has a single button and toolbar, and just the message box in the button click. So let the wizard create all the code except the one line for the message box.-Jeff
Public Class Button1 Inherits ESRI.ArcGIS.Desktop.AddIns.Button Public Sub New() End Sub Protected Overrides Sub OnClick() ' ' TODO: Sample code showing how to access button host ' My.ArcMap.Application.CurrentTool = Nothing End Sub Protected Overrides Sub OnUpdate() Enabled = My.ArcMap.Application IsNot Nothing End Sub End Class
Thanks for the suggestion, Jeff. I will attempt to see if that works now.
<ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Name>ERMDTools</Name> <AddInID>{eb6ba448-f56d-4ac4-9ba8-1ae452fb5519}</AddInID> <Description>Conversion of my VBA tools to add coordinates to tables and such.</Description> <Version>1.0</Version> <Image>Images\ERMDTools.png</Image> <Author>Dale R. Bridgford</Author> <Company>SOM</Company> <Date>12/13/2010</Date> <Targets> <Target name="Desktop" version="10.0" /> </Targets> <AddIn language="CLR" library="ERMDTools.dll" namespace="ERMDTools"> <ArcMap> <Commands> <Button id="SOM_ERMDTools_AddPolygonCentroid" class="btnAddPolygonCentroid" message="Adds the X and Y coordinates of each polygon's centroid (center of mass) to the attribute table" caption="Polygon Centroid XY" category="Bridgford Tools" image="Images\AddPolygonCentroid.png" tip="Adds the latitude and longitude of the polygon's centroids"></Button> <Button id="SOM_ERMDTools_AddPolyLineCentroid" class="btnAddPolyLineCentroid" message="Adds the X and Y coordinates of each polyline's centroid (center of mass) to the attribute table." caption="Polyline Centroid XY" category="Bridgford Tools" image="Images\AddPolyLineCentroid.png" tip="Adds the latitude and longitude of the polyline's centroid."></Button> <Button id="SOM_ERMDTools_AddXY" class="btnAddXY" message="Adds the XY coordinates of the point to the attribute table." caption="Point XY" category="Add-In Controls" tip="Adds XYs to the Attribute Table" image="Images\AddXY.png"></Button> <Button id="SOM_ERMDTools_AddXYZ" class="btnAddXYZ" message="Adds XYZ of DataFrame and XY of feature" category="ERMDTools" caption="Add XYZ and XY" tip="Populates attribute table with XYZ of dataframe and xy of feature so you get two sets of coordinates for the price of one." image="Images\AddXYZ.png"></Button> <Button id="SOM_ERMDTools_AddHyperlink" class="btnAddHyperlink" message="Creates Hyperlink to ERMD's WDS Webpage." caption="Add Hyperlink" category="Add-In Controls" tip="Generates a Hyperlink based upon data in attribute tables and places hyperlink in attribute table" image="Images\AddHyperlink.png"></Button> </Commands> <Toolbars> <Toolbar id="SOM_ERMDTools_ERMD_Tools" caption="ERMD Tools" showInitially="true"> <Items> <Button refID="SOM_ERMDTools_AddHyperlink" /> <Button refID="SOM_ERMDTools_AddXY" separator="true" /> <Button refID="SOM_ERMDTools_AddXYZ" separator="true" /> <Button refID="SOM_ERMDTools_AddPolyLineCentroid" separator="true" /> <Button refID="SOM_ERMDTools_AddPolygonCentroid" separator="true" /> </Items> </Toolbar> </Toolbars> </ArcMap> </AddIn> </ESRI.Configuration>
Imports ESRI.ArcGIS.Geometry Namespace ERMDTools Public Class btnAddHyperlink Inherits ESRI.ArcGIS.Desktop.AddIns.Button Public Sub New() End Sub Protected Overrides Sub OnClick() Dim pFeature As IFeature, pLayer As ILayer Dim pMap As IMap Dim pSRE As SpatialReferenceEnvironment Dim pQF As IQueryFilter Dim pMSR As ISpatialReference Dim pGeoDataset As IGeoDataset Dim pMxDoc As ESRI.ArcGIS.ArcMapUI.IMxDocument pMxDoc = Nothing pMxDoc = m_App.Document pMap = pMxDoc.FocusMap pMSR = pMap.SpatialReference
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.