POST
|
Process.Start("path\to\mxd") totally worked! Thank you very much!!!
... View more
08-12-2011
09:11 AM
|
0
|
0
|
178
|
POST
|
Hi there, I'm trying to create a new ArcMap instance (ie. open a map in a separate ArcMap window) once a user clicks a button on an addin form. I can get the map to open - but it's in the same ArcMap window (see code below).
Dim mApp As ESRI.ArcGIS.Framework.IApplication
Dim mDoc As ESRI.ArcGIS.Framework.IDocument
mDoc = My.ArcMap.Application.Document
mApp = mDoc.Parent
mApp.Visible = True
mApp.NewDocument(False, <file>)
How do I get the map to open in a new ArcMap window? I'm using ArcMap 10 and Visual Basic Express .NET 2008 SP1. Cheers, Olwyn
... View more
08-11-2011
02:47 PM
|
0
|
2
|
2234
|
POST
|
So the Final Solution for me was to completely nuke and pave my system. Apparently, I'm not the only one in our GIS world here that is having major problems with add-ins - this isn't the first time this has happened. It makes me pretty leary about wanting to develop with them, if it's going to turf my system! It's probably some deeply buried setting but - like anyone - I don't have the time to futz around with it. ESRI - any suggestions here? Any settings I can check or advice to pass on here? Cheers, Olwyn
... View more
07-18-2011
08:26 AM
|
0
|
0
|
607
|
POST
|
HI Jeff, Perfect - I'm going to try that first and then, if that fails, do a COMPLETE uninstall/reinstall of ArcMap, VS2008 & the SDK. I was just over at my co-workers and his system is the same as mine - his worked straight off! So, clearly, there's something wrong on my end. I'll post the results...thank you once again for all the help. Cheers, Olwyn
... View more
07-14-2011
10:00 AM
|
0
|
0
|
607
|
POST
|
Hi Jeff, I really appreciate your help on this. I'm going to ask a co-worker of mine to install the software and do parts 3 & 4 as well - maybe it's some weird, obscure setting on my system. We'll see 😉 I uninstalled/reinstalled VS2008 and the SDK late yesterday so the solution I've attached was built in this new "clean" install. Still the same behavior (greyed out button after click, with no message box). Any tips would be terrific. Cheers, Olwyn
... View more
07-14-2011
08:39 AM
|
0
|
0
|
607
|
POST
|
Hi Jeff, I looked at that thread - lots of good information! However, I seem to still be having problems. I went back to the beginning and followed your tutorial at gis.qtools.com (VBA to C add-in). My system is: Windows 7, 64-bit Visual C# Express 2008 SP1 ArcMap 10.0 SP2 (ArcInfo) I did parts 3 & 4. I'm able to make a toolbar with a button but nothing happens when I click on it (it just goes grey). Here's the code from config.esriaddinx: <ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>CSTutorial</Name>
<AddInID>{4e2c325a-27f5-4d4b-b2a0-266819364cc2}</AddInID>
<Description>C# tutorial</Description>
<Version>1.0</Version>
<Image>Images\CSTutorial.png</Image>
<Author>jobruce</Author>
<Company>YGS</Company>
<Date>7/13/2011</Date>
<Targets>
<Target name="Desktop" version="10.0" />
</Targets>
<AddIn language="CLR" library="CSTutorial.dll" namespace="CSTutorial">
<ArcMap>
<Commands>
<Button id="YGS_CSTutorial_StaggerOffsetButton" class="StaggerOffsetButton" message="Stagger Offset: Offsets all feature in selected layer by a user-specified stagger amount on either side of the original position. Start an edit session before use." caption="Stagger Offset Features" tip="Stagger Offset Features: Offsets all features in selected layer." category="Add-In Controls" image="Images\StaggerOffsetButton.png" />
</Commands>
<Toolbars>
<Toolbar id="YGS_CSTutorial_CS_Toolbar" caption="CS_Toolbar" showInitially="true">
<Items>
<Button refID="YGS_CSTutorial_StaggerOffsetButton" />
</Items>
</Toolbar>
</Toolbars>
</ArcMap>
</AddIn>
</ESRI.Configuration> Here's the code from StaggerOffsetButton.cs: using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;
namespace CSTutorial
{
public class StaggerOffsetButton : ESRI.ArcGIS.Desktop.AddIns.Button
{
public StaggerOffsetButton()
{
}
protected override void OnClick()
{
//
// TODO: Sample code showing how to access button host
//
ArcMap.Application.CurrentTool = null;
MessageBox.Show("Hello world");
}
protected override void OnUpdate()
{
Enabled = ArcMap.Application != null;
}
}
} Any suggestions? I'd really like to start customizing with .NET but having zero luck so far. Olwyn
... View more
07-13-2011
12:16 PM
|
0
|
0
|
607
|
POST
|
Hi Sean, There is no .tlb file. How do I generate one using Visual Studio Express 2008? Cheers, Olwyn
... View more
07-11-2011
02:24 PM
|
0
|
0
|
619
|
POST
|
Hi there, I'm trying to check out the ViperPIN sample and am encountering some problems. I downloaded the VB.NET code, compiled it in VS Express 2008 and registered it using ESRIRegAsm.exe. Then I tried adding it to ArcMap 10 (Customize > Add from file...) and got a "can't load type library from specified file" error. Any suggestions? Olwyn
... View more
07-07-2011
12:12 PM
|
0
|
6
|
3137
|
POST
|
Hi there, I'm trying to learn how to use Visual Studio to create a button that loads a form. I'm using Visual Studio Express 2008 (VB.NET). I've followed, step by step, two tutorials: http://gis.qtools.com/blog/tutorials/vba-to-c-add-in/part-4-creating-new-add-in-project/ (up to Part 4 and using VB.NET) http://www.esri.com/news/arcuser/0311/recycling-vba.html In neither tutorial have I been able to get a form to load. In the case of the first tutorial, I can't even get a message box to display. It's pretty frustrating. So, I started from scratch in a new project (ArcMapAddIn1). It is a button (Button1) on a toolbar (My Toolbar). When the button is pressed a message box is supposed to pop up (this is under the OnClick event for Button1). Nothing happens when I press the button! It just goes grey. Any ideas about what I'm missing here? Cheers, Olwyn
... View more
07-06-2011
03:46 PM
|
0
|
9
|
1011
|
POST
|
Hi there, In the VBA/ArcObjects world, I had created an app that automatically sized the data frame and page size based on the user selection (in their case, an NTS map sheet). I'm trying to migrate this app into the 10.0 world and can access arcpy.mapping to change the data frame size - but is there any Python (or other) solution to programmatically change the page size? Currently, I'm experimenting with this using data driven pages. Any input welcome 😉 Cheers, Olwyn
... View more
07-06-2011
09:57 AM
|
0
|
1
|
1888
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|