POST
|
Hi everyone, Has anyone figured out a way to add a Menu to the MAIN (Root) menu toolbar using Addins? So a menu in between File and EDIT or after HELP. I know you can modify the Main Toolbar via ESRIRegAsm com object w/ deployed MSI installable.. but what about ADDINS? I can Create a new Menu ... but then unable to do anything from there...(button wise) in an Extention Addin Setting: Dim TopMenuBar As ESRI.ArcGIS.Framework.ICommandBar
TopMenuBar = GetToolbarByName(My.ArcMap.Application, "esriArcMapUI.MxMenuBar")
TopMenuBar.CreateMenu("Menu TEST", 1) The Main Toolbar {56599DD3-E464-11D1-9496-080009EEBECB} esriArcMapUI.MxFileMenu Thanks, in advance.
... View more
06-24-2011
09:17 AM
|
0
|
9
|
2371
|
POST
|
Both great ideas! and complement each other for full automation. Modify the xml or better yet, thanks Sean! Very slick OS feature. Thank you both! -Mike Full solution was creating an exe that did everything. Modifying the machines xml for addin folder path as well as using the folder2.self.verbs.item(i).DoIt() on the network path to initialize offline caching. (looking for the "Always &available offline" of course... for the integer value) works slick, one click... everyone is happy.
... View more
05-13-2011
06:43 AM
|
0
|
0
|
623
|
POST
|
Both great ideas! and complement each other for full automation. Modify the xml or better yet, thanks Sean! Very slick OS feature. Thank you both! -Mike
... View more
05-10-2011
06:38 AM
|
0
|
0
|
623
|
POST
|
Hopefully someone has a solution to this... ESRI has this cool ability for Shared Addins, using a server path for example within an organization. Unfortunately, once the machine is un-plugged from that network, the path, along with all the tools are removed... this causes issues for Laptop users as well as the odd network glitch (if it happens during arc startup / shutdown) The ability to plug into the network with, lets say a laptop, have the most recent tools through the shared addin, unplug, go to a meeting somewhere else, utilize those tools, then get any updates once plugged back into the network seems ideal and care free for the user. Otherwise, its drag all the files over, repath addisn to that folder, once back at office, remove path, re-path to other, open arc, close arc to set the latest addins in place. Except for that cool part where ESRI decided to have the Addin REMOVE everything, INCLUDING the folder path in the Options tab of the addin manager if the path is no longer there, I like addins otherwise. Suggestions? Opinions? Am I missing something? workarounds? Currently using Editor 10.0 Build 3200 on most machines. I guess just another custom program to be made...
... View more
05-09-2011
09:47 AM
|
0
|
6
|
1041
|
POST
|
My recommendation is to stick with 3.5 and move to 4.0 only after ESRI supports it. BINGO! Search function is your friend!
... View more
05-09-2011
07:05 AM
|
0
|
0
|
782
|
POST
|
I will REPOST what I posed: its in my above post: If TypeOf pMap.Layer(j) Is ESRI.ArcGIS.Carto.IGroupLayer
... View more
05-06-2011
07:28 AM
|
0
|
0
|
836
|
POST
|
Hi everyone, I was wondering, if someone would enlighten me on this small, but annoying issue. Either I am severly looking over something, or ESRI has a bit more fine tuning to do. When creating an extension (using Addins template); I am Unable to get the text within the Description box to create New Lines (or CRLF) or <br> (Ive tried it all), just using ENTER in the XML. All the ESRI extensions have a nice written description without having one long line requiring a scroll over. Perhaps I need more coffee. I have attached a visual.
... View more
04-28-2011
12:55 PM
|
0
|
2
|
637
|
POST
|
Well, its not that easy... Pending which version as well, 9.3 prior, you must make the toolbar/button with IToolbarDef code... then its hooking to the application from there... registering the dll using regasm32 on a windows xp machine If you are using 10, you then use addins, now you have to write the XML and such... You will notice .THISdocument is now replaced wtih namespace MY when using addins... Here is your converted code, but unfortunately, its not just going to be a copy paste, publish and it works. There is more involved. e.g. Gathering the references associating the class into ArcMap etc.... button etc. Not sure, but your code is just simply adding a field, perhaps a model would suit you better. Imports System.Windows.Forms
Imports ESRI.ArcGIS.ArcMapUI
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.Geodatabase
Public Class Class1
Sub AddField_Name1()
Try
'
'
Dim pMxDoc As IMxDocument
Dim pLayer As ILayer
Dim pFLayer As IFeatureLayer
Dim pFeatClass As IFeatureClass
Dim NewField As IFieldEdit
Dim strFieldName As String
Dim intFieldType As Integer
Dim intLength As Integer
'
'
'Verweis auf das aktuelle Dokument
pMxDoc = My.ArcMap.Document 'ThisDocument
'
pLayer = pMxDoc.SelectedLayer
If pLayer Is Nothing Then
MessageBox.Show("Achtung, es ist kein Layer selektiert", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Exit Sub
End If
pFLayer = pLayer
pFeatClass = pFLayer.FeatureClass
'
' Eingabe der Feldnamen
strFieldName = "Name1"
'
'
NewField = New Field
With NewField
.Length_2 = 75
.Type_2 = esriFieldType.esriFieldTypeString
.Name_2 = strFieldName
End With
'
' Kontrolle, ob Feldname schon vorhanden
If pFeatClass.FindField(strFieldName) > -1 Then
MessageBox.Show("Das Feld '" & strFieldName & "' ist bereits vorhanden, bitte anderen Feldnamen angeben!", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
Else
MessageBox.Show( "Das Feld '" & strFieldName & "' ist noch nicht vorhanden und wird erzeugt!")
End If
'
pFeatClass.AddField(NewField) 'Neues Feld wird hinzugefügt
'
Catch ex As Exception
MessageBox.Show("Es ist ein Fehler aufgetreten, das Programm wird beendet!", "", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
End Class
... View more
04-08-2011
09:11 AM
|
0
|
0
|
440
|
POST
|
OP, I would quickly assume that they did not add their .net developer kit and use the Template to create their addin... My is the Namespace created when created using the Developer Template addin CLASS. (Your addin solution) Namespace My will contain the Friend Module ThisAddin and pass any XML information to the Solution project. Friend Module ArcMap
Private s_app As ESRI.ArcGIS.Framework.IApplication
Private s_docEvent As ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event
Public ReadOnly Property Application() As ESRI.ArcGIS.Framework.IApplication
Get
If s_app Is Nothing Then
s_app = TryCast(Internal.AddInStartupObject.GetHook(Of ESRI.ArcGIS.ArcMapUI.IMxApplication)(), ESRI.ArcGIS.Framework.IApplication)
End If
Return s_app
End Get
End Property
Public ReadOnly Property Document() As ESRI.ArcGIS.ArcMapUI.IMxDocument
Get
If Application IsNot Nothing Then
Return TryCast(Application.Document, ESRI.ArcGIS.ArcMapUI.IMxDocument)
End If
Return Nothing
End Get
End Property
Public ReadOnly Property ThisApplication() As ESRI.ArcGIS.ArcMapUI.IMxApplication
Get
Return TryCast(Application, ESRI.ArcGIS.ArcMapUI.IMxApplication)
End Get
End Property
Public ReadOnly Property DockableWindowManager() As ESRI.ArcGIS.Framework.IDockableWindowManager
Get
Return TryCast(Application, ESRI.ArcGIS.Framework.IDockableWindowManager)
End Get
End Property
Public ReadOnly Property Events() As ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event
Get
s_docEvent = TryCast(Document, ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event)
Return s_docEvent
End Get
End Property
End Module Then you can use My namespace and get ArcMap.Application rhalko: Why should ESRI document how to use XML? We all know special characters in different codes require attention. Hopefully your afternoon gets better now that you found what was wrong. XML characters If you want to use & & e.g. <company>AT&T</company>
... View more
04-07-2011
11:58 AM
|
0
|
0
|
661
|
POST
|
Hi everyone, Simple but frustrating problem: Prior to arcAddinx, there was no problem choosing to have Image / Text or Both for any button when a toolbar was loaded using the following code below triggered off the ENABLED using ESRICommandStyles. (IToolbarDef) Public Sub SetAsIconAndText()
' Make sure button is showing Icon And Text
Dim pUID As New UID
pUID.Value = "{F53B91E1-C520-41a7-941C-686AA071D1A2}" ' Toolbar GUID
Dim pCommandBar As ESRI.ArcGIS.Framework.ICommandBar
pCommandBar = m_application.Document.CommandBars.Find(pUID, True, False)
Dim i As Integer
If Not pCommandBar Is Nothing Then
For i = 0 To pCommandBar.Count - 1
If pCommandBar.Item(i).Name = "FocusCorp_FocusEllipse" Then ' use the Property NAME of the button
pCommandBar.Item(i).Style = esriCommandStyles.esriCommandStyleIconAndText
Exit For
End If
Next
End If
End Sub I am aware that a user can AFTER the fact customize, but why would ESRI have left this functionality out with Addin XML? Is there anyone that has found the means to control what each button displays on created toolbars when using Addins as far as Image and Caption? Suggestions appreciated, vb.net Thanks
... View more
04-07-2011
07:50 AM
|
0
|
13
|
8083
|
POST
|
Yes, I publish tools all the time that allow arcmap interaction while forms are up. (Downfall is user can alter TOC and other stuff while in the middle of your processes if your program involves counts etc, it can get messy, but thats besides the point. FormWindowState.Normal and do a [Your]form.show()
... View more
04-04-2011
11:38 AM
|
0
|
0
|
826
|
POST
|
My apologies for mis-understanding, Jill. I suggested My. as within a class, that works in .net for any form and yes, of course it would not work if the function is outside the form class. I am aware every form will have an initialize, its Private Sub InitializeComponent() or your probably referring to FormLoad ? there is no Initialize as you put it that I see in vb.net for a declaration. So the function is all on its own (separate class). Ok, which is calling a table. Sorry, I would just have the function in each form class... not sure how this would be achieved. Neil will hopefully guide you in the right direction and I will learn something.
... View more
04-01-2011
10:04 AM
|
0
|
0
|
705
|
POST
|
Its Mike, you need to be using 3.5 framework, not 4 (that is not until release 10.1) from what I understood at the summit: You can not be using 'any CPU' when compiling and sending off to a 64 bit run processor hence why i mentioned x86. You can no longer use RegASM as a means, hence why esri incorporated their own. If your stating your dlls are ANY CPU, you will see failures as you see. You can verify this by hitting a 32 bit machine, and everything probably works. Hence why unable to find 10.0 esri.arcGisSystem dll, because they are only 32 bit dlls Are you using .net 2010 professional or similar? Which arc are you using? SP1 installed? Have you tried contacting someone from ESRI? Have you read http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/What_s_new_for_developers_at_10/0001000002zp000000/ and http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/ESRIRegAsm_utility/0001000004n6000000/ The registration logic within existing libraries does not need to be rewritten (categories are still identified using globally unique identifiers [GUIDs]), but existing libraries must be re-registered with ESRIRegAsm.exe or they will not function with any installation of ArcGIS after version 9.3.1.
... View more
04-01-2011
06:57 AM
|
0
|
0
|
1164
|
POST
|
Well, not quite sure what you are trying to attempt.. but I see a few things. a) There is NO need for a function, your not sending a return value. so as for the Form. IF its all in the same CLASS, just use me. Are you suggesting that sub UserForm is a Different form than THISForm? Private Sub UserForm_Initialize()
PopulateEditorNameComboBox()
End Sub
Public Sub PopulateEditorNameComboBox()
For i = 1 to EditorNameCollection.Count
me.cboEditor.AddItem (EditorNameCollection.item(i)) 'Add item to combo box on indicated form
Next i
End Function
There are many methods to pass data between forms if that is what you are doing... Delegates / Properties /contructor / object
... View more
04-01-2011
06:52 AM
|
0
|
0
|
705
|
Title | Kudos | Posted |
---|---|---|
1 | 01-06-2016 11:32 AM | |
1 | 12-13-2021 10:03 PM | |
1 | 07-19-2017 07:31 AM | |
1 | 01-18-2016 07:23 AM | |
1 | 01-08-2016 02:43 PM |
Online Status |
Offline
|
Date Last Visited |
12-25-2023
08:32 AM
|