POST
|
I've found something : var runtimes = ESRI.ArcGIS.RuntimeManager.InstalledRuntimes; foreach (var info in runtimes) { System.Diagnostics.Debug.Print(info.Product.ToString()); System.Diagnostics.Debug.Print(info.Version); System.Diagnostics.Debug.Print(info.Path); } The assembly is ESRI.ArcGIS.Version
... View more
10-30-2012
01:41 PM
|
0
|
0
|
439
|
POST
|
Hello, I have a problem since the last version of ArcGis, the 10.1, was released. My problem is the following : When using the DataManagement Clip tool, there's a parameter named nodata_value which was a Double in ArcGis 10 and now it's a string. So when someone uses my program with ArcGis 10.1, he gets this error : System.MissingMethodException: Method not found: 'Void ESRI.ArcGIS.DataManagementTools.Clip.set_nodata_value(Double)'. ArcGis 10.1 : http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000009n000000 ArcGis 10.0 : http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000009n000000 So a solution may be to check the current version of ArcGis and give the good parameter : if(arcgis10_1) nodata_value = myDoubleValue.ToString(); else nodata_value = myDoubleValue; But I don't know how to recognize in which version I am. Thank you for your help. M. Ciftci
... View more
10-30-2012
03:20 AM
|
0
|
1
|
2302
|
POST
|
Most of the code is generated automatically when you create a button and a dockable window in visual studio.
... View more
04-09-2012
11:27 PM
|
0
|
0
|
427
|
POST
|
Then, you have to create a button to open/close your dockable window : [Guid("a048cbf6-e22b-4fa1-a803-b044d66e1b3e")] [ClassInterface(ClassInterfaceType.None)] [ProgId("DockCommand")] public sealed class DockCommand : BaseCommand {[INDENT]private static IApplication m_application; private static IDockableWindow m_dockableWindow; private const string DockableWindowGuid = "{74036c8c-fa64-41fa-bfcf-d261e24b641f}"; #region COM Registration Function(s) [ComRegisterFunction()] [ComVisible(false)] static void RegisterFunction(Type registerType) { [/INDENT] [INDENT=2]// Required for ArcGIS Component Category Registrar support ArcGISCategoryRegistration(registerType);[/INDENT] [INDENT]} [ComUnregisterFunction()] [ComVisible(false)] static void UnregisterFunction(Type registerType) { [/INDENT] [INDENT=2]// Required for ArcGIS Component Category Registrar support ArcGISCategoryUnregistration(registerType);[/INDENT] [INDENT]} #region ArcGIS Component Category Registrar generated code private static void ArcGISCategoryRegistration(Type registerType) { [/INDENT] [INDENT=2]string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); MxCommands.Register(regKey);[/INDENT] [INDENT]} private static void ArcGISCategoryUnregistration(Type registerType) { [/INDENT] [INDENT=2]string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); MxCommands.Unregister(regKey);[/INDENT] [INDENT]} #endregion #endregion public DockCommand() { [/INDENT] [INDENT=2]base.m_enabled = true; base.m_category = "bla bla"; //localizable text base.m_caption = "bla bla bla"; //localizable text base.m_message = "bla bla"; //localizable text base.m_toolTip = "bla bla bla"; //localizable text base.m_name = "bla bla bla"; //unique id, non-localizable (e.g. "MyCategory_ArcMapCommand") [/INDENT] [INDENT=2] try { [/INDENT] [INDENT=3]string bitmapResourceName = GetType().Name + ".bmp"; base.m_bitmap = new Bitmap(GetType(), bitmapResourceName);[/INDENT] [INDENT=2]} catch (Exception ex) { [/INDENT] [INDENT=3]System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap");[/INDENT] [INDENT=2]}[/INDENT] [INDENT]} #region Overriden Class Methods public override void OnCreate(object hook) { [/INDENT] [INDENT=2]if (hook != null) [/INDENT] [INDENT=3]m_application = hook as IApplication;[/INDENT] [INDENT]} public override void OnClick() { [/INDENT] [INDENT=2]if (m_application == null) [/INDENT] [INDENT=3]base.m_enabled = false;[/INDENT] [INDENT=2] LaunchDock();[/INDENT] [INDENT]} public override bool Checked { [/INDENT] [INDENT=2]get { [/INDENT] [INDENT=3]return m_dockableWindow != null && m_dockableWindow.IsVisible();[/INDENT] [INDENT=2]}[/INDENT] [INDENT]} #endregion //Initialize the dockable window private static void SetupDockableWindow() { [/INDENT] [INDENT=2]if (m_dockableWindow == null) { [/INDENT] [INDENT=3]IDockableWindowManager dockWindowManager = m_application as IDockableWindowManager; if (dockWindowManager != null) { [/INDENT] [INDENT=4]UID windowID = new UIDClass(); windowID.Value = DockableWindowGuid; m_dockableWindow = dockWindowManager.GetDockableWindow(windowID);[/INDENT] [INDENT=3]}[/INDENT] [INDENT=2]}[/INDENT] [INDENT]} public static bool LaunchDock() { [/INDENT] [INDENT=2]if(!this.Checked) { [/INDENT] [INDENT=3]if (m_dockableWindow == null) { [/INDENT] [INDENT=4]//start the form here : Form myForm = new MyForm(); //myForm.Show(); SetupDockableWindow(); m_dockableWindow.Show(true);[/INDENT] [INDENT=3]} else { [/INDENT] [INDENT=4]m_dockableWindow.Show(true);[/INDENT] [INDENT=3]}[/INDENT] [INDENT=2]} else { [/INDENT] [INDENT=3]m_dockableWindow.Show(false);[/INDENT] [INDENT=2]}[/INDENT] [INDENT]}[/INDENT] }
... View more
04-04-2012
03:49 AM
|
0
|
0
|
427
|
POST
|
First, you have to implement IDockableWindowDef Interface : [Guid("74036c8c-fa64-41fa-bfcf-d261e24b641f")] [ClassInterface(ClassInterfaceType.None)] [ProgId("MyDock")] public class MyDock : IDockableWindowDef {[INDENT]private static IApplication m_application; public static IApplication application { [/INDENT] [INDENT=2]get { [/INDENT] [INDENT=3]return m_application;[/INDENT] [INDENT=2] }[/INDENT] [INDENT] } #region COM Registration Function(s) [ComRegisterFunction()] [ComVisible(false)] static void RegisterFunction(Type registerType) { [/INDENT] [INDENT=2]// Required for ArcGIS Component Category Registrar support ArcGISCategoryRegistration(registerType); [/INDENT] [INDENT] } [ComUnregisterFunction()] [ComVisible(false)] static void UnregisterFunction(Type registerType) { [/INDENT] [INDENT=2]// Required for ArcGIS Component Category Registrar support ArcGISCategoryUnregistration(registerType); // // TODO: Add any COM unregistration code here //[/INDENT] [INDENT] } [/INDENT] [INDENT]#region ArcGIS Component Category Registrar generated code private static void ArcGISCategoryRegistration(Type registerType) { [/INDENT] [INDENT=2]string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); MxDockableWindows.Register(regKey);[/INDENT] [INDENT] } private static void ArcGISCategoryUnregistration(Type registerType) { [/INDENT] [INDENT=2]string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID); MxDockableWindows.Unregister(regKey);[/INDENT] [INDENT]} #endregion[/INDENT] [INDENT] #endregion public RCPManagerDock() { } #region IDockableWindowDef Members string IDockableWindowDef.Caption { [/INDENT] [INDENT=2]get { [/INDENT] [INDENT=3]return "My Dock";[/INDENT] [INDENT=2] }[/INDENT] [INDENT] } int IDockableWindowDef.ChildHWND { [/INDENT] [INDENT=2]get { [/INDENT] [INDENT=3]return myForm.Handle.ToInt32(); //You give your form's handle to the dock here[/INDENT] [INDENT=2] }[/INDENT] [INDENT] } string IDockableWindowDef.Name { [/INDENT] [INDENT=2]get { [/INDENT] [INDENT=3]return myForm.Name;[/INDENT] [INDENT=2] }[/INDENT] [INDENT] } void IDockableWindowDef.OnCreate(object hook) { [/INDENT] [INDENT=2]m_application = hook as IApplication;[/INDENT] [INDENT] } void IDockableWindowDef.OnDestroy() { } object IDockableWindowDef.UserData { [/INDENT] [INDENT=2]get { return null; }[/INDENT] [INDENT] } #endregion [/INDENT] }
... View more
04-03-2012
11:50 PM
|
0
|
0
|
427
|
POST
|
I found a solution : have to use the ShowInTaskbar property of Windows Form. Not needed in Arcmap 9.
... View more
03-16-2012
03:08 AM
|
0
|
0
|
427
|
POST
|
Hi, I use a dockable window in Arcmap 10 in which I display a Windows Form. My question is : is it possible to remove the icon of the Form in taskbar ? I don't have this problem in Arcmap 9. Thanks !
... View more
03-16-2012
01:26 AM
|
0
|
7
|
2832
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|