POST
|
Hi My requirement is to Open an Arc map application and close it automatically through C# coding. For that I Wrote below code IDocument pDoc = new MxDocumentClass(); pApp = pDoc.Parent; pApp.OpenDocument(sMxdFileName); if (pApp != null) { pApp.Shutdown(); } // pApp.saveDocument is not working Everything is fine , But before shutdown statement is executing , In Map same dialog box like save changes to Mxd and Yes or No Buttons are avaialble there. We should able to handle that control also through coding before execute the Shutdoen statement.i.e we should close the document opened with affected changes. can u please suggest me the code for that
... View more
04-24-2013
10:55 PM
|
0
|
1
|
3846
|
POST
|
Right Click on Your Solution and go for Properties and In That Go for Application TAB, and in that change Output Type combo Box Option to Windows Application, then Your Problem will resolved.
... View more
03-19-2013
02:13 AM
|
0
|
0
|
1065
|
POST
|
Yes it is possible. I have done this for zooming to an extent. I created an extension, defined a custom interface for my extension. Implemented both IExtension and my custom interfaced on it. Put the extents I wanted to zoom to as public properties on the extension (doubles.) In my other project with the command, I reference the assembly with the extension. Then from the application object, I get a reference to the custom extension running in the other ArcMap, cast it to my custom interface, set the properties (doubles.) For literal values, that is fine, if you want to pass in objects (a layer for example,) you need to use an object factory to create the object in the ArcMap process space. Thank you Very Much for Ur response...... We Understood the concept, additonal to that we need some samples for reference. Can u please provide the samples (to define custom interface on Extension , and calling Extension from Other Project).......We are Missing something even we followed the process what you suggested, that's why I am asking.... Please help me on this.
... View more
03-18-2013
10:13 PM
|
0
|
0
|
215
|
POST
|
Hi... I Created a arc Map Command and Wrote some Code. I Opened Arc Map Programmatically using C# and Executed that Command from an External Application using ICommandItem Concepts. Command is Executing fine.. But My requirement is to pass some parameters to that command from External Application.With that Inputs taken from External Application, Command Will execute. Is it Possible??.. If Possible.. Suggest me the way. Thanks in Advance.
... View more
03-18-2013
12:17 AM
|
0
|
2
|
680
|
POST
|
// Code in ext.cs using System; using System.Drawing; using System.Runtime.InteropServices; using ESRI.ArcGIS.ADF.BaseClasses; using ESRI.ArcGIS.ADF.CATIDs; using ESRI.ArcGIS.Framework; using ESRI.ArcGIS.ArcMapUI; using ESRI.ArcGIS.esriSystem; namespace NE_EXT { /// <summary> /// Summary description for NEConvertExt. /// </summary> [Guid("d1bb6202-5f18-4509-977c-79aecfbf9c62")] [ClassInterface(ClassInterfaceType.None)] [ProgId("NE_EXT.NEConvertExt")] public sealed class NEConvertExt : IExtension { private IApplication m_application; IMxDocument pMxDoc; string sMxdFileName = "C:\\Documents and Settings\\abc\\Desktop\\mXD'S\\abc.mxd"; #region IExtension Members public string Name { get { return "ConvertToNEExtension"; } } public void Shutdown() { //throw new NotImplementedException(); m_application = null; } public void Startup(ref object initializationData) { m_application = initializationData as IApplication; if (m_application == null) return; } #endregion public void CreateWorkorder(string WoName,string WoType) { } public void OpenWorkorder(string WoName) { } public void Convert(string strServer,string strInstance,string strUserName,string strVersion) { } I wrote above code in IExtension class. I want to access these Methods in another External Application ,for That // Code in EXtApp.cs if (!b_ArcMapStarted) { IDocument pDoc = new MxDocumentClass(); pApp = pDoc.Parent(); pApp.OpenDocument(sMxdFileName);//Opened a saved Mxd pApp.Visible = false; IExtension objExt; // Created I Extension Object objExt = pApp.FindExtensionByName("ConvertToNEExtension"); if (objExt != null) { objExt.c// Here that methods are not accesible, I didn't get what's the problem is }
... View more
03-11-2013
08:13 PM
|
0
|
2
|
773
|
POST
|
Hi. My requirement is to get Features in a Featureclass with a specific Version Only........ Using ArcObjects in C#, I am Getting Dataset of type Featureclass and then Features using IFeatureWorkspace. Now I want to get Features only related to a specific Version only.. Can any one help me in this code...Any Function available to pass Version as parameter??...or any other suggestion??...... Thanks In Advance......
... View more
03-02-2013
08:44 AM
|
0
|
1
|
569
|
POST
|
I am trying to get all dataset names and feature class available in ARC sde..... i WROTE BELOW CODE..... bUT i AM GETTING ERROR LIKE oPERATION FAILED.. CAN ANY ONE SUGGEST ME THE SOLUTION... IWorkspaceFactory pWF = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass(); IPropertySet pPropertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass(); pPropertySet.SetProperty("SERVER", "172.16.8.56"); pPropertySet.SetProperty("INSTANCE", "1522"); pPropertySet.SetProperty("DATABASE", "@C:\\Documents and Settings\\ABC\\Application Data\\ESRI\\ArcCatalog"); pPropertySet.SetProperty("USER", "ABC"); pPropertySet.SetProperty("PASSWORD", "ABC"); pPropertySet.SetProperty("VERSION", "ABC"); IWorkspace pWorkSpace = pWF.Open(pPropertySet, 0); IEnumDataset enumDataset = pWorkSpace.get_Datasets(esriDatasetType.esriDTAny); IDataset pDataSet = enumDataset.Next(); while (pDataSet != null) { string DSetName = pDataSet.Name; }
... View more
02-25-2013
12:45 AM
|
0
|
3
|
797
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|