|
POST
|
Yes, you need to use IObjectFactory to create all instances of the ArcObjects that will be used in conjunction with the ArcMap application. If you have a map document created that has all of the layers, symbology, layout elements, etc that you need then you can use IMapDocument to open the document and work with it. This includes zooming the map frames to various extents and exporting the layout. You can also manipulate the layout by adding elements or modifying existing elements. Things can get complicated if you need to create layouts from scratch every time but it's about the same level of effort trying to do the same thing by automating ArcMap. I've never run into a case where automating ArcMap was needed and I would try to avoid it like the plague. ArcMap wasn't designed to be automated and the whole process is flaky and, in my opinion, a lot more trouble than it's worth.
... View more
07-13-2011
06:12 AM
|
0
|
0
|
3579
|
|
POST
|
I'm not familiar with the Inova dll so I don't know what it's for or why it's being called. However, when performing geometric operations with multiple geometries it's usually a good idea to make sure they are all in the same spatial reference. I check the FactoryCodes of the spatial references involved and if they don't match then I call IGeometry.Project to project one of the geometries into the spatial reference of the other.
... View more
07-13-2011
06:01 AM
|
0
|
0
|
959
|
|
POST
|
You can't use New to create instances of the objects you will be using in conjunction with the ArcMap application.. You need to be using IObjectFactory. Your application and ArcMap are running in seperate processes. All ArcObjects are single apartment threaded, meaning they will not marshal correctly when used across process boundaries. Therefore, you will need to create the ArcObjects instances in ArcMap's process space, not your application's process space. IObjectFactory will do this for you. There is a developer sample on Automation that you might want to look at.
... View more
07-13-2011
05:49 AM
|
0
|
0
|
3579
|
|
POST
|
As an alternative approach in addition to the suggestions already made, have you thought about returning the user account from the Windows Authentication (WindowsIdentity)? I use this in ALL of my ArcGIS applications because it's great to be able to throw around that user credential in many different components (for db logon, CrystalReporting, etc...). Anyway, below is a bit of code sampe that you might be able to use. Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Principal
Imports System
Public Class Form1
Private m_User As String
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim logonToken As IntPtr = LogonUser()
m_User = GetUserName(logonToken)
'Now you can use the m_User in your app for reporting/doing stuff with the current user that is
'logged into with Windows Authentication
End Sub
Private Function LogonUser() As IntPtr
Dim accountToken As IntPtr = WindowsIdentity.GetCurrent().Token
Return accountToken
End Function
Function GetUserName(ByVal logonToken As IntPtr) As String
Dim windowsIdentity As New WindowsIdentity(logonToken)
Dim parts() As String = Split(windowsIdentity.Name, "\")
Dim username As String = parts(1)
Return username
End Function An easier way to do this in .NET is System.Environment.UserName.
... View more
07-12-2011
05:18 AM
|
0
|
0
|
1366
|
|
POST
|
Have you looked at IGeometryBridge2.SplitAtDistances or SplitDivideLength?
... View more
07-12-2011
05:14 AM
|
0
|
0
|
2178
|
|
POST
|
If you wrap the call to StartEditing in a Try/Catch block I believe it will throw an exception if the workspace is locked by another user.
... View more
07-11-2011
07:17 AM
|
0
|
0
|
900
|
|
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
... View more
06-27-2011
10:13 AM
|
0
|
0
|
1713
|
|
POST
|
Hello, When I try to create an instance of ESRI.ArcGIS.Geoprocessor()... Did you mean ESRI.ArcGIS.Geoprocessor.Geoprocessor? ESRI.ArcGIS.Geoprocessor is the name of the library where the Geoprocessor class is defined.
... View more
05-24-2011
05:29 AM
|
0
|
0
|
924
|
|
POST
|
The WhereClause property expects a string, therefore you must set it using a string expression. queryFilter.WhereClause = fieldName & " = '" & stringValue & "'" If the field isn't a text field then you must remove the single quotes.
... View more
05-23-2011
06:04 AM
|
0
|
0
|
950
|
|
POST
|
The envelope method works irrespective of the shape of your polygons... This is not true. The OP wants the corner coordinates of square/rectangular polygons. Unless those polygons are exactly oriented to the x, y axes using the Envelope method will not return the corner vertex coordinates of that polygon. It will return the coordinates of the envelope that encompasses the polygon. See the examples in the developer help topic for IGeometry.Envelope. To get the coordinates of the vertices that make up the polygon, use the IPointCollection interface.
... View more
05-23-2011
05:57 AM
|
0
|
0
|
2187
|
|
POST
|
I'm not sure what you're doing will even work. The most common way to extrude features in a layer is to add a field to the feature class that contains the extrusion value for each feature. Then set the layer to extrude on that field through the layer properties dialog.
... View more
05-23-2011
05:41 AM
|
0
|
0
|
496
|
|
POST
|
Sounds like you changed the project type from Windows Application to Class Library. If that's the case then you need to change it back.
... View more
05-19-2011
10:51 AM
|
0
|
0
|
685
|
|
POST
|
Can you not use IGeoFeatureLayer.Renderer to assign the renderer from the layer file to the layer?
... View more
05-19-2011
06:54 AM
|
0
|
0
|
675
|
|
POST
|
Can I add a mapcontrol to a dockable window in ArcMap 9.3 without the EDN?. Yes. Prior to ArcGIS 10, the MapControl and PageLayoutControl were distributed with both the Desktop SDK and the Engine SDK. You can use them to customize ArcGIS Desktop as well as in standalone applications. At ArcGIS 10, these controls are no longer distributed with the Desktop SDK. You can still use them the same as before but you will need to purchase an Engine developer license and install the Engine SDK. You don't need an Engine runtime license for an ArcGIS customization as the Desktop license is still sufficient.
... View more
05-11-2011
12:15 PM
|
0
|
0
|
2566
|
|
POST
|
Every class registered on your computer is listed in the system registry under HKEY_CLASSES_ROOT. Just use the Find function to look for ICadLayer.
... View more
04-29-2011
12:42 PM
|
0
|
0
|
995
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-20-2014 05:29 AM | |
| 1 | 02-01-2011 04:18 AM | |
| 1 | 02-04-2011 04:15 AM | |
| 1 | 01-17-2014 03:57 AM | |
| 1 | 10-07-2010 07:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|