|
POST
|
What are you trying to do? There's no way to determine a spatial reference given a set of x,y coordinates because the range of x,y values are not unique to a particular spatial reference. In other words, you can't say that because my point has coordinates 0, 0 that it is in the Nad 83 Utm Zone 18N spatial reference because a point whose coordinates are 0, 0 could be in any spatial reference. "Setting the spatialreference property of the point does not change the x,y values. " This is correct. When you set the SpatialReference property on a point object you are specifying the spatial reference of the point, not performing any kind of transformation. If you want to project the point from one spatial reference to another then you should be calling the Project method. The point object will need to already have a spatial reference set on it before calling Project.
... View more
03-15-2012
01:23 PM
|
0
|
0
|
729
|
|
POST
|
I believe this is a known issue when you enable XP Visual Styles within your application. Several of our apps were affected by this and turning off visual styles was not an option because it makes the UI look horrible. I just tested it again and it no longer seems to be happening. I'm running ArcGIS 9.3.1 Service Pack 2 on Vista 64-bit.
... View more
03-15-2012
11:05 AM
|
0
|
0
|
1093
|
|
POST
|
There are probably other properties you need to set on the symbol. It looks like the 3d marker symbol classes all implement IMarker3DPlacement so try setting the various properties on that interface and see if it does what you want.
... View more
03-15-2012
05:21 AM
|
0
|
0
|
2193
|
|
POST
|
I don't think you need any additional licensing to do this. I just ran the following VBA code in ArcMap 9.3.1 with all of my extensions turned off and it worked. Sub profileTest()
Dim mxDocument As IMxDocument
Set mxDocument = ThisDocument
Dim rasterLayer As IRasterLayer
Set rasterLayer = mxDocument.FocusMap.layer(7)
Dim surface As ISurface
Set surface = GetSurfaceFromLayer(rasterLayer)
Dim fromPoint As IPoint
Set fromPoint = New point
fromPoint.PutCoords 286000, 4271200
Dim toPoint As IPoint
Set toPoint = New point
toPoint.PutCoords 286500, 4271200
Dim polyline As IPolyline
Set polyline = New polyline
polyline.fromPoint = fromPoint
polyline.toPoint = toPoint
surface.GetProfile polyline, polyline
Dim pointCollection As IPointCollection
Set pointCollection = polyline
Dim i As Long
For i = 0 To pointCollection.PointCount - 1
Dim point As IPoint
Set point = pointCollection.point(i)
MsgBox point.X & ", " & point.Y & ", " & point.Z
Next i
End Sub
Function GetSurfaceFromLayer(rasterLayer As IRasterLayer) As ISurface
Dim surface As ISurface
Dim layerExtensions As ILayerExtensions
Set layerExtensions = rasterLayer
Dim i As Long
For i = 0 To layerExtensions.ExtensionCount - 1
Dim dddProperties As I3DProperties
Set dddProperties = layerExtensions.Extension(i)
If dddProperties.BaseOption = esriBaseSurface Then
Set surface = dddProperties.BaseSurface
End If
Next
If surface Is Nothing Then
Dim rasterBandCollection As IRasterBandCollection
Set rasterBandCollection = rasterLayer.Raster
Dim rasterBand As IRasterBand
Set rasterBand = rasterBandCollection.Item(0)
Dim rasterSurface As IRasterSurface
Set rasterSurface = New rasterSurface
rasterSurface.rasterBand = rasterBand
Set surface = rasterSurface
End If
Set GetSurfaceFromLayer = surface
End Function
... View more
03-14-2012
01:45 PM
|
0
|
0
|
2442
|
|
POST
|
Looks like ESRI has an updated walkthrough for this. I skimmed through it and it looks like everything you need is in there. Post back if you have any problems or questions. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_deploy_a_custom_component_using_a_setup_project/00010000016r000000/
... View more
03-14-2012
12:31 PM
|
0
|
0
|
1920
|
|
POST
|
The problem may be here: Dim pSymbol As ISymbol = New SimpleMarkerSymbolClass() pSymbol = TryCast(styleItem.Item, ISymbol) Don't set the symbol to a new instance of the SimpleMarkerSymbolClass. Just do this: Dim pSymbol As ISymbol = TryCast(styleItem.Item, ISymbol) The symbol probably isn't a SimpleMarkerSymbol but a Marker3DSymbol.
... View more
03-14-2012
06:55 AM
|
0
|
0
|
2193
|
|
POST
|
You're not giving the point a z value so the element is being positioned at the coordinates you gave it but at elevation 0. When you create the point, make it z aware and give it an appropriate value.
... View more
03-14-2012
06:20 AM
|
0
|
0
|
2193
|
|
POST
|
The following worked for me as far as getting the data into ArcMap. I wasn't able to figure out how to access the data through a workspace though. Dim rasterLayer As ESRI.ArcGIS.Carto.IRasterLayer = New ESRI.ArcGIS.Carto.RasterLayer
rasterLayer.CreateFromFilePath("E:\Development\N10E012.hgt")
rasterLayer.Name = "test layer"
DirectCast(m_application.Document, IMxDocument).FocusMap.AddLayer(rasterLayer)
DirectCast(m_application.Document, IMxDocument).UpdateContents()
As for having to recreate functionality for your app, be sure to investigate all of the builtin tools that Engine offers as well as the geoprocessing library. There's quite a bit of functionality there may be something you can use in your app.
... View more
03-13-2012
01:21 PM
|
0
|
0
|
858
|
|
POST
|
You can try a couple of things. Use Categories.exe (located in the ArcGIS Desktop bin directory) to see if the dockable window is listed under ESRI Mx Dockable Windows. If it isn't, then that means Add from File isn't registering the class. You should be able to use this utility to register the dockable window. Personally, I use the setup to do all of the registration. If you want to try that then let me know and I can tell you how to do that.
... View more
03-13-2012
07:05 AM
|
0
|
0
|
1920
|
|
POST
|
I should have some time later today to see if I can load the data you posted into ArcMap through code. I don't have a current EDN subscription so I can't try it with an Engine app but the process should be the same. I'll let you know if I manage to figure it out.
... View more
03-13-2012
06:53 AM
|
0
|
0
|
3747
|
|
POST
|
That looks correct to me. One thing I would try is to load this data as a layer into ArcMap. Right click the layer and save it out as a layer file then load the layer file into your map control using IMapControl.AddLayerFromFile and see what happens.
... View more
03-13-2012
06:19 AM
|
0
|
0
|
3747
|
|
POST
|
Just to make sure the problem isn't something else, is your application binding to a product and checking out a license before you attempt to run this code? You'd get the same type of error at the same line of code if the application isn't initialized with a proper license.
... View more
03-13-2012
06:01 AM
|
0
|
0
|
3747
|
|
POST
|
I'm not familiar with that type of data but according to the chart in the link you provided it is a single file with the *.hgt extension. So, to open it using a raster workspace I would guess that you need to provide the path to the file instead of the path to the folder when opening the workspace.
... View more
03-13-2012
05:11 AM
|
0
|
0
|
3747
|
|
POST
|
Yes, you have to register the dockable window with ArcMap. It's the same code as registering a command or toolbar only you specify a different component category. Here's the code that should go in class that implements IDockableWindowDef: #Region "COM Registration Function(s)"
<ComRegisterFunction(), ComVisibleAttribute(False)> _
Public Shared Sub RegisterFunction(ByVal registerType As Type)
' Required for ArcGIS Component Category Registrar support
ArcGISCategoryRegistration(registerType)
'Add any COM registration code after the ArcGISCategoryRegistration() call
End Sub
<ComUnregisterFunction(), ComVisibleAttribute(False)> _
Public Shared Sub UnregisterFunction(ByVal registerType As Type)
' Required for ArcGIS Component Category Registrar support
ArcGISCategoryUnregistration(registerType)
'Add any COM unregistration code after the ArcGISCategoryUnregistration() call
End Sub
#Region "ArcGIS Component Category Registrar generated code"
''' <summary>
''' Required method for ArcGIS Component Category registration -
''' Do not modify the contents of this method with the code editor.
''' </summary>
Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type)
Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
MxDockableWindows.Register(regKey)
End Sub
''' <summary>
''' Required method for ArcGIS Component Category unregistration -
''' Do not modify the contents of this method with the code editor.
''' </summary>
Private Shared Sub ArcGISCategoryUnregistration(ByVal registerType As Type)
Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
MxDockableWindows.Unregister(regKey)
End Sub
#End Region
#End Region
How are you deploying this? If you're using a standard Windows installer then you'll need to add code inside of an Installer class to call esriRegAsm. If you're using the Add From File method on the Customize dialog I think it will pick up the dockable window but I'm not certain.
... View more
03-12-2012
12:56 PM
|
0
|
0
|
1920
|
|
POST
|
If the query is correct then it might be something else related to the data because there's nothing wrong with the code you posted as far as I can see. Could it be a permissions issue? Your code is getting an Update cursor so is an edit session necessary for the type of data you're going to be editing? Does the feature class participate in a network, topology or something like that? Can you start an edit session on this feature class in ArcMap?
... View more
03-12-2012
10:35 AM
|
0
|
0
|
2687
|
| 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
|