|
POST
|
Just give a spatial Reference Environment such as createprojectedCoordinateSystem Add point to a featurelayer Get the spatial reference of the featureclass... pPoint.PutCoords(x,y) >> values from the entered by the user then project to the featureclass pPoint.Project(pSpatialReference) You can then add attributes / fields to the featureclass... pFeature.Shape = pPoint pFeature.Store () I do this, but using Local Coordinates, sent to a web-service for conversion... etc.. but you will get the idea. 'get the spatial information from the shapefile and add the new point with attributes to the point file
'Need to look at what projection or lat/long of the shapefile where the point is being created.
Dim pSpatialReferenceWebServices As ESRI.ArcGIS.Geometry.ISpatialReference
Dim pSpatialReferenceEnvironment As New ESRI.ArcGIS.Geometry.SpatialReferenceEnvironment
Dim pGeodataset As ESRI.ArcGIS.Geodatabase.IGeoDataset
Dim pSpatialReference As ESRI.ArcGIS.Geometry.ISpatialReference
'Spatial Reference passed from Webservies
pSpatialReferenceWebServices = pSpatialReferenceEnvironment.CreateProjectedCoordinateSystem(pSpatialInt)
'Add point to selected layer feautre class
Dim pFeatureClass As ESRI.ArcGIS.Geodatabase.IFeatureClass
pFeatureClass = pPointLayer.FeatureClass ' runtime will not occur as its in the above if statement checking for selected feature
'get the projection of the featurelayer
pGeodataset = pFeatureClass
pSpatialReference = pGeodataset.SpatialReference
Dim pPoint As New ESRI.ArcGIS.Geometry.Point
'give the point the reference from the WkID given from the webservices
pPoint.SpatialReference = pSpatialReferenceWebServices
pPoint.PutCoords(pXCoord, pYCoord)
'now project to the featureclass spatial reference
pPoint.Project(pSpatialReference)
... View more
07-12-2011
01:52 PM
|
0
|
0
|
1162
|
|
POST
|
Hi, I wanted to know if it was possible to programmatically add additional add-in folders (network path) in the Add-In Manager dialog box. Hence the end user doesn't need to do it. This should also enable the developer to provide later version of the add-in without need to re-send the new add-in file. Is this possible. Thanks Sure it possible.. How we run it all here. Went further and wrote an exe as an ADDIN installer... one click program modifying that xml for the user as well as enabling OFFLINE server folder path for caching, the user doesn't have to do a thing. Remember, using a network path, the second the network is unavailable.. alll the tools are deleted from the users machine... and is NOT restored either!.. as the network path in the xml or seen by the user under addins-manager (options) is automatically removed. So caching is a must... e.g. Offline for windows 7. its great though, everyone has the deployed addins, even our custom Patch and Service pack updater to keep everyone up to date automatically... any changes made, is made through the restricted write server folder... everyone gets the new update instantly. Pending on the OS being used... windows 7 has the AddinFoldersList.xml stored under USERS >> [USER] >> AppData >> Local >> ESRI >> Desktop10.0.. and all the assemblies from the addinx file land under the assembly directory (a protected operating system file) and then under their corresponding UID as their folder name. So to see this folder, you must UN-CHECK Hide Protected Operating System Files, Its not a 'Hidden Folder'. Then you see your UID folder.. e.g. \AssemblyCache\{ABCB2AE5-4AA6-67AE-052A-DC8126BAB0AA} And then its just your normal dll (toolset or extension etc..) with the corresponding files like the good old days of COM and packaging as an MSI. (but not registered in the Registry this way...) Pass and embed anything over to the local machine as well would end up in this folder, nice and convenient to access.
... View more
06-30-2011
12:14 PM
|
0
|
0
|
1065
|
|
POST
|
Anyone ? No one attempted to modify the Main Bar? add a menu and add a button in the menu with addins?
... View more
06-30-2011
06:33 AM
|
0
|
0
|
1872
|
|
POST
|
Many of our installers write values to the registry which are then read by our ArcGIS extensions. We've never had to change anything with the registry keys in order to make our applications install and run on both 32-bit and 64-bit machines. See this article on MSDN: http://msdn.microsoft.com/en-us/library/aa384232(v=vs.85).aspx Agreed. I only use this as I have made a Patch and Service pack automation program... separate issue from the OP and not related to the thread... Just thought I would post how to, but your link covers all the answers.
... View more
06-27-2011
11:19 AM
|
0
|
0
|
1520
|
|
POST
|
Try to use HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\Desktop10.0 for ArcGIS Desktop It should works fine on 32bit and 64 bits WinOS. if you need ArcGIS Engine use HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGIS Engine Runtime Good luck, No, this information is incorrect and only applies to a 32 bit OS. i know this post is somewhat old, but I thought I would post the solution and correct info As the OP stated, using a 64 bit OS windows 7 application changes the Keys to a sub folder called \ \Wow6432Node\ This is where the \Wow6432Node\ ESRI \ ArcGIS \ InstallDir value can be found to determine installation directory. What I do, for anyone reading this is to use a function I wrote to determine the OS first, then knowing which OS, find out if its 64 or 32 bit, to go through the appropriate SUBKEY folders and value sets. e.g. Public Function Is64Bit()
'will return 64 or 32
Is64Bit = GetObject("winmgmts:root\cimv2:Win32_Processor='cpu0'").AddressWidth
End Function And getting OS version Public Function GetOSVersion() As String
Select Case Environment.OSVersion.Platform
Case PlatformID.Win32S
Return "Win 3.1"
Exit Function
Case PlatformID.Win32Windows
Select Case Environment.OSVersion.Version.Minor
Case 0
Return "Win95"
Exit Function
Case 10
Return "Win98"
Exit Function
Case 90
Return "WinME"
Exit Function
Case Else
Return "Unknown"
Exit Function
End Select
Case PlatformID.Win32NT
Select Case Environment.OSVersion.Version.Major
Case 3
Return "NT 3.51"
Exit Function
Case 4
Return "NT 4.0"
Exit Function
Case 5
Select Case _
Environment.OSVersion.Version.Minor
Case 0
Return "Win2000"
Exit Function
Case 1
Return "WinXP"
Exit Function
Case 2
Return "Win2003"
Exit Function
End Select
Case 6
Return "Vista/Win2008Server/Windows7" '
Exit Function
Case Else
Return "Unknown"
Exit Function
End Select
Case PlatformID.WinCE
Return "Win CE"
Exit Function
End Select
Return "Unknown"
End Function
... View more
06-27-2011
08:01 AM
|
0
|
0
|
1520
|
|
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
|
3685
|
|
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
|
1517
|
|
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
|
1517
|
|
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
|
1935
|
|
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
|
1715
|
|
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
|
1904
|
|
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
|
1153
|
|
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
|
1196
|
|
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
|
1459
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 09-27-2024 09:04 AM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|