|
POST
|
Probably the easiest way to do this would be to use the feature class to feature class geoprocessing tool. You can call this tool through code using the objects in the Geoprocessing library. This tool will allow you to copy an entire feature class or apply a query filter to copy only a subset. I believe you'll need to create the target feature class prior to calling the tool but I'm not sure on that.
... View more
02-02-2011
07:56 AM
|
0
|
0
|
1218
|
|
POST
|
I haven't done much at all with addins but if you were doing this the old way you would be implementing a tool control. This is done by implementing ICommand and IToolControl. You would enable/disable the control using the ICommand.Enabled property. The addin probably has something similar. Look for an Enabled property that you can implement or set.
... View more
02-02-2011
05:03 AM
|
0
|
0
|
1497
|
|
POST
|
Unless I'm missing something in your code the problem is that you're setting your IMapDocument using the document's focus map. It's the MxDocument class that implements IMapDocument, not the Map class. You should be setting the IMapDocument reference using the IMxDocument reference, not the focus map. I haven't tried it so I don't know if it's actually implemented or not. I would assume it is since the developer help says it is (and this is new at 10). You can also save the document using the IApplication interface, which is how it has been done in the past.
... View more
02-02-2011
04:57 AM
|
0
|
0
|
2609
|
|
POST
|
One thing you'll need to be aware of when you do something like this is that ArcMap and ArcScene are running in two separate processes. Objects from one process should not be used in the other as they are COM objects that are single apartment threaded and will not marshall correctly between processes. You shouldn't do something like take a layer from ArcMap and add it directly to ArcScene. If you do so, the layer object is being used in two processes. The recommended thing to do would be to deep clone the layer object and add the clone to ArcScene. Most ArcObjects classes can be deep cloned using the IObjectCopy interface. Do not use the IClone interface as this only performs a shallow clone. The other thing to be aware of is you shouldn't call New to create new instances of objects that you intend to use in the other process. You should use IObjectFactory to create these instances. This will create the object in the correct process space for you.
... View more
02-02-2011
04:45 AM
|
0
|
0
|
1209
|
|
POST
|
"I am trying to create the FeatureDataSet for the Featureclass from the derived table I have retreived from SQL." I'm not sure what this means. A feature dataset is a container. You can't create one "from" a table or feature class. You simply create a new feature dataset inside the geodatabase and add the feature class to it (a feature dataset cannot contain tables). The feature dataset can be created by calling IFeatureWorkspace.CreateFeatureDataset. The feature class you're creating should be created using IFeatureDataset.CreateFeatureClass. Of course, you don't have to put a feature class inside of a feature dataset. They can be standalone. Feature datasets are mainly used to organize related data. To create the feature class as a standalone class you call IFeatureWorkspace.CreateFeatureClass.
... View more
02-02-2011
04:38 AM
|
0
|
0
|
1218
|
|
POST
|
Use the search box at the top of the page. There is also a link to the archived forums where you can also search. There is also a sample for using the IGxDialog in the developer help.
... View more
02-02-2011
04:16 AM
|
0
|
0
|
1996
|
|
POST
|
query1 = "RequestDate = '" & UserInput1 & Format(RequestDate, "MM/DD/YYYY") & "'" 'doesn't work You're delimiting the date value with single quotes. That's incorrect syntax for the flavor or SQL that Access databases use. 'query1 = "RequestDate = #02-05-2011 00:00:00# " , this hardcoded works You're delimiting the date with pounds. This is correct. So, replace the single quotes in your first line with pounds.
... View more
02-01-2011
04:18 AM
|
1
|
0
|
1804
|
|
POST
|
A file geodatabase is a folder that contains many files that make up the database. You can't browse to a folder using a file browser; you need to use a folder browser. Or just use the standard IGxDialog used by the ArcGIS Desktop applications.
... View more
02-01-2011
04:11 AM
|
0
|
0
|
1996
|
|
POST
|
I managed to find time to give this a quick try in .NET. I placed a Panel on a form to use as the map canvas. Here's the code I added to the form class. I didn't have time to run any real tests or create any custom tools to zoom, pan, etc. but it seems to work fairly well. The scroll bars don't work properly - clicking the arrows pans the map but grabbing the scroll bar with the mouse doesn't. Public Class MapDialog
Private m_activeView As IActiveView
Private Sub LoadMapButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadMapButton.Click
Try
Dim path As String = "C:\Development\ApplicationTest\Mxd\Quantico.mxd"
Dim mapDoc As IMapDocument = New MapDocument
mapDoc.Open(path)
Dim map As IMap = mapDoc.Map(0)
Dim activeView As IActiveView = DirectCast(map, IActiveView)
activeView.Activate(Panel1.Handle.ToInt32)
m_activeView = activeView
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
Private Sub Panel1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
If m_activeView Is Nothing Then Return
m_activeView.Draw(Panel1.CreateGraphics.GetHdc.ToInt32, Nothing)
End Sub
End Class
... View more
01-28-2011
11:39 AM
|
0
|
0
|
880
|
|
POST
|
Use IDataset.Delete as shown in the original reply. Instead of getting a layer from the map just open the shapefile yourself using IFeatureWorkspace.OpenFeatureClass.
... View more
01-28-2011
11:32 AM
|
0
|
0
|
1895
|
|
POST
|
I agree that changing the licensing for the MapControl a decade after its release isn't a good thing. However, you probably don't need the control to perform those unit tests. Use the IMapDocument interface to open a document you've created for the tests and get the map reference from it. You should be able to draw your graphics and export them just fine. We have several programs that process directories full of map documents and export images and pdfs at various extents and scales withiout ever opening them for display. Also, it is possible to create your own map control. The IActiveView interface has an Activate method that will allow you to associate the view with any control that has a drawing context (picture box, panel, etc). After calling Activate, you will need to call the Draw method inside that control's Paint event. I haven't bothered to try this in .NET yet but we created such a control in VB6 way back in 8.0.1 when the MapControl had yet to be released. I know this would mean extra development effort, but it is possible and could serve as a workaround to having to purchase another development license.
... View more
01-28-2011
07:43 AM
|
0
|
0
|
880
|
|
POST
|
There are classes in the .NET Framework for handling this sort of thing. Because the location of system and special Windows folders differs from OS to OS, you should use these built-in classes when dealing with the file system. The location of the Program Files folder can be determined in Visual Basic with the following code: Dim programFilesPath As String = My.Computer.FileSystem.SpecialDirectories.ProgramFiles You can then append any subdirectory paths and/or filenames as needed.
... View more
01-25-2011
08:54 AM
|
0
|
0
|
1105
|
|
POST
|
The first thing I see is that you are not releasing the cursor and feature references. It is very important that you do so. A typical code block for querying a feature class and processing the cursor would look something like this: Dim featureCursor As IFeatureCursor = featureClass.Search(Nothing, False)
Dim feature As IFeature = featureCursor.NextFeature
Do While feature IsNot Nothing
' do something with the feature
Marshal.FinalReleaseComObject(feature)
feature = featureCursor.NextFeature
Loop
Marshal.FinalReleaseComObject(featureCursor) Basically, you should be releasing the cursor and row references immediately after you are done with them. This includes releasing Feature and Row objects within loops BEFORE setting them to the next object in the cursor. Release the cursor references as soon as you're finished with the Feature/Row objects.
... View more
01-21-2011
11:11 AM
|
0
|
0
|
520
|
|
POST
|
I believe IDisplay.ClipGeometry is what you're looking for but I've never tried it.
... View more
01-21-2011
05:25 AM
|
0
|
0
|
982
|
|
POST
|
If you're trying to customize the menu then I'm assuming that you're trying to get a reference to the menu so you can add something to it. If that's the case then you don't need the name. The GUID will work just fine. Also, if you have the GUID of a class you can always look it up in the system registry. The class name according to the registry is esriArcMapUI.MapViewCommandsContextMenu. Dim uid As New UID
uid.Value = "{3846A5B5-D3F8-44CB-BFA3-A5C30F4E535F}"
Dim commandItem As ICommandItem = application.Document.CommandBars.Find(uid)
... View more
01-21-2011
05:21 AM
|
0
|
0
|
606
|
| 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
|