Tag Info

Hot answers tagged

6

Take a look at the following: Esri Migration doc Specifically Reference ESRI.ArcGIS.ADF.Local assembly Set ESRI assemblies Specific Version property Platform CPU target changes


5

Yes, since you are presumably using VB.NET (not VB, which is 20+ years old and no longer supported), you need to use the Imports statement to import namespaces. Specifically you want to put Imports ESRI.ArcGIS.Geometry at the top of your code files. Alternatively you could fully qualify the IPoint type every time you use it (ESRI.ArcGIS.Geometry.IPoint) ...


5

I think VS2010 only works if you point it at the .NET 3.5 framework, not the 4.0. Kind of makes 2010 redundant imo. I don't think it will work properly Arc 10 (sp1) VS2010, VS 2008 and VS Express 2008 - all 3.5 Framework. with ArcGIS 10.1 - 4.00 framework and VS2010 So: VS2010 if you use the .net 3.5 framework. Standard and Professional work. VS2010 ...


5

It appears you have a setup project that is part of your solution. You might try having it run EsriRegasm, as described in Chris Garrard's blog post. When you build your project you'll also need to call EsriRegasm, as described here. <Target Name="BeforeClean"> <Exec WorkingDirectory="$(CommonProgramFiles)\ArcGIS\bin" ...


5

In addition to @jmhauck answer; because the application framework has changed in version 10 you might also consider just to build a new extension using the ArcGIS 10 SDK using one of the "Extending ArcObjects" templates and copy your functions and procedures from your legacy extension. More info on extending ArcObjects here


4

Instead of checking for a selection directly in the button's OnUpdate routine, which runs very frequently, I would write an extension that uses event handlers to respond to selection events and caches the selection state of your layer, and then in the OnUpdate routine check the extension's cached state. Of course this is probably overkill if there is only ...


4

You need a function that returns the selection set count property on your layer. If the count is >0 than you can enable your button. ISelectionSet.Count Property


4

The syntax for combobox (as well as other controls) is different in VB.NET. You should review the help to see the changes. cmbBox.ListCount --> cmbBox.Items.Count cmbBox.List(l) --> cmbBox.Items.Item(l) cmbBox.AddItem(sItem, l) --> cmbBox.Items.Insert(l, sItem) cmbBox.AddItem(sItem) --> cmbBox.Items.Add(sItem)


4

I don't want to do your homework for you, but much of the framework already exists. Try looking at Script Tools. You will have to write the python script yourself, but it can very easily be run from ArcToolbox. The UI comes from the ArcGIS desktop, and has the standard look and feel.


3

When you set up a reference to an assembly, you have the option for "Specific Version". When you add a reference manually, by default it is True. The references added by Esri's SDK tools set it to False. You should be able to highlight multiple references in the Solution Explorer and change multiple assembly references' Specific Version to False. (At ...


3

So here is how I successfully solved the issue -- although I did go through every one of the settings for the x86 again -- I removed EVERY reference to the ArcObject interfaces and re-added them to the project. I also, removed and re-added my Unit Test project. In doing this, I was able to catch one of the x86 references that I could have missed the ...


3

You are able to access the supporting libaries; but you would need to build the UI all yourself. ArcEngine offers you the ability to create your own run-time apps using ESRI technology; but you have to assemble the general flow yourself.You also need to make sure you handle the license needs properly with the extensions; yes the ability is there but again ...


3

I believe your command line should read: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe C:\Temp\Mydll.dll /tlb:Mytlb.tlb /codebase Not directly related to your problem, but I would also advise against naming the type library file differently than the DLL as it violates the standard naming convention. I.e. use Mydll.tlb instead of Mytlb.tlb.


2

ByRef and ICursor are underlined. ByRef = Expression expected and ICursor error = ICursor is a type and cannot be used as an expression. When you have the keyword ByRef you can ONLY have a variable following it. What you have following it is a function. ByRef means that the variable you are giving to the function you expect to change in the ...


2

The code below works for me. using System; using System.Text; using System.Net; using Newtonsoft.Json; using System.IO; using Newtonsoft.Json.Linq; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { try { string baseUrl = ...


2

(Months later...) The answer is to not reference 3rd party dependencies if they aren't on the clients' machines and you aren't distributing them with your add-in. In this case it was the Visual Basic Power Packs dependency, which from the sounds of it wasn't being used anyways. You should also be sure to implement error handling at all entry points to your ...


2

If you have created an add-in and added a ESRI.ArcGIS.Desktop.AddIns.Tool to it then stub out the following event: Protected Overrides Sub OnMouseDown(ByVal arg As ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs) ' --write your function here-- End Sub arg.X and arg.Y will be the coordinates where the user clicked. You will most likely want to ...


2

If this is an Add-in, you'll have to make a modification to the config.esriaddinx file also. Take a look at the section about Delay Loading in the add-in concepts help, where it says to set the onDemand attribute to false. The line will look something like this: <Button id="YourAddIn_Button1" class="Button1" message="Add-in command generated by Visual ...


2

So, apparently BING sends its "your key is expired" error message under status 200. OpenLayers, quite reasonably, assumed that status 200 meant "O.K." when BING meant "we're too lazy to do this correctly." Naturally, Chrome Developer Tools, FireBug, and Visual Studio did the same thing and reported no problem and until the script tried to run. So note to the ...


1

The first thing you should do is put Try..Catch blocks in your code. This will make it much easier to figure out why the code is crashing. Here is an example Private Sub FindSmallestPolygon() 'This requires the feature class to be in a geodatabase 'or has the field "Shape_Area" already calculated with the area Dim pLayer As ...


1

Have you tried putting it in a runas call? That is, instead of Command="esriRegasm.exe &quot;$(TargetPath)&quot; /p:Desktop " /> do Command="runas.exe /noprofile /savecred /user:Administrator esriRegasm.exe &quot;$(TargetPath)&quot; /p:Desktop " /> in the build step's command. Alternately, you can edit the shortcut to devenv.exe ...


1

The machines where you deploy the toolbar must be at the same version & service pack or lower. In your solution expand the References and highlight all the Esri references. In the properties for the Esri references make sure the property for 'Specific Version' is set to False. Also, the user installing the toolbar must have priviledges to write to the ...


1

You said: "Thanks, eric, I put the try/catch where you said and a break at the message after catch and I recieved this error: "Public member 'FindExtensionByName' on type 'MxDocument' not found."...I assume this is in my code" editor = My.ArcMap.Document.FindExtensionByName("ESRI Object Editor")" Try replacing it with: editor = ...


1

Have you made reference to the editor, e.g.? 'Get a reference to the editor. Dim uid As UID uid = New UIDClass() uid.Value = "esriEditor.Editor" Dim editor As IEditor editor = CType(m_application.FindExtensionByCLSID(uid), IEditor)


1

Here are some suggestions: Include some additional try catch statements into your code so you can identifly what line is giving you the error. Try 'Your code here Catch ex As Exception MessageBox.Show("Caught an unspecified error in the calling code: " & vbCrLf & ex.ToString) End Try May want to check that Intialize is a ...


1

I updated the function that finds the default browser. Here is the working code. Protected Overrides Sub OnMouseDown(ByVal arg As ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs) MyBase.OnMouseDown(arg) Try My.ArcMap.Application.CurrentTool = Nothing Dim pMxDoc As IMxDocument Dim pMap As IMap ...


1

There is some JSON helpers i ArcObjects that you might be able to use, but I'm not sure if they are supported on the client side though: SOESupport.JsonObject


1

Check your com libraries. It could be they are not registered and the .net hooks into them are not able to instantiate them. This is just a guess though. EDIT Try this... It is a link to an esri help article that describes how to register objects. Sorry I can't help with a specific answer, I've never had issues with unregistered arc objects, but I ...


1

If it works on PCs with programming software and not on PCs that don't have it, then you are missing a redistributable runtime program on the other computers. Here is the one for VB6 and there is one for VB.NET, C#, C++ etc. Usually your installation program should take care of providing the redistrubutable, but either it didn't or you are not using an ...


1

I'm not sure if ArcEngine is different from desktop. Just set the icon in the master base class and do not set it on the children classes. Something like: public class UniversalCustomCommand:BaseCommand { public UniversalCustomCommand() { base.m_bitmap = new Bitmap(GetType(),"path to icon"); } } public class ...



Only top voted, non community-wiki answers of a minimum length are eligible