|
POST
|
The IActiveView.Output method can export an image with specific bounds that can then be copied to where ever. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Output_Method/0012000001n9000000/ http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Create_JPEG_from_ActiveView_Snippet/004900000064000000/
... View more
06-19-2012
07:51 AM
|
0
|
0
|
443
|
|
POST
|
Does the program work if the dbf is alone in the folder?
... View more
06-18-2012
11:26 AM
|
0
|
0
|
2811
|
|
POST
|
This might be a data problem rather than a code problem. Have you tried adding the dbf from the ArcMap add data command (not in code)?
... View more
06-18-2012
10:44 AM
|
0
|
0
|
2811
|
|
POST
|
You pMap variable is not strongly typed, that means it gets the type of the variable you are passing in (an IActiveView.) This would work but is still bad: dim pMap as IMap = My.ArcMap.Document.ActiveView It is bad for several reasons. 1. it won't work with Option strict on (which would flag the first problem.) 2. It won't work if you are in layout view in ArcMap, since in LayoutView, the ActiveView is a PageLayout (Map and PageLayout implement IActiveView. The document has a maps method which is a collection of the maps in your document (there may be more than one.) You can pick the first but it may still be incorrect. I like using the IMxDocument.FocusMap. If you are in data view, you get the map loaded into view, if you are in layout mode, you get the map which is selected on the page layout.
... View more
06-18-2012
09:50 AM
|
0
|
0
|
1096
|
|
POST
|
Yes, there a lot of things kind of strange with this forum... People posting questions and then posting an answer and marking their own post as the answer post. However, the points are browny points anyway and the value comes from the users not from the points. As far as getting the correct layer, yes the code you posted should work as long as you have the option strict off (which I don't recommend.) Option strict forces you to explicit cast (type conversion) to the specific type before you pass in an argument to a method. In your case, your method signature calls for an IFeatureLayer. Your method passes in an ILayer. That works fine as long as the ILayer happens to be a FeatureLayer. All FeatureLayers implement ILayer but lots of other types of layers implement ILayer such as grouplayer, rasterlayer, etc. and don't implement IFeatureLayer. Explicitly casting your ILayer to IFeatureLayer is a better practice. Dim fLayer as IfeatureLayer = ctype(pMap.Layer(0), IFeatureLayer) SelectMapFeaturesByAttributeQuery(pMap.ActiveView, flayer, "PID = '00000000'") Now there is always the chance the first layer in the map is not a featurelayer, in which case the first line would fail if typeof pMap.Layer(0) is IFeatureLayer then Dim fLayer as IfeatureLayer = ctype(pMap.Layer(0), IFeatureLayer) SelectMapFeaturesByAttributeQuery(pMap.ActiveView, flayer, "PID = '00000000'") End if or better yet, trycast returns nothing if the cast fails Dim fLayer as IfeatureLayer = trycast(pMap.Layer(0), IFeatureLayer) if fLayer isnot Nothing then SelectMapFeaturesByAttributeQuery(pMap.ActiveView, flayer, "PID = '00000000'") end if You can write a for loop to go from 0 to pMap.LayerCount -1 and look at the layer of featureclass name. However, if you hit a group layer, it will be skipped and you will never look at the sub layers and also the code will crash if your map is empty (you can check the layercount before calling.) I prefer to use the IMap.Layers method. Dim featLayerUid As New UIDClass featLayerUid.Value = "{40A9E885-5533-11D0-98BE-00805F7CED21}" 'IFeatureLayer Dim enumLayer As IEnumLayer = pMap.Layers(featLayerUid , True) 'True argument looks at sub layers in a group enumLayer.Reset() Dim layer As ILayer = enumLayer.Next Do While Not (layer Is Nothing) dim fLayer as IFeatureLayer = CType(layer, IFeatureLayer) 'Guaranteed to work since only querying IFeatureLayers. if ctype(fLayer.FeatureClass, IDataset).Name = "Name_I_am_looking_for" then SelectMapFeaturesByAttributeQuery(pMap.ActiveView, fLayer, "PID = '00000000'") exit do end if layer = enumLayer.Next() Loop
... View more
06-18-2012
09:34 AM
|
0
|
0
|
1948
|
|
POST
|
First off there is a difference between featureclass and featurelayer. The featureclass is the data source (like a table) and the featurelayer is the representation of the data (like a report.) The featurelayer may or may not have the same name as the featureclass. You still have to loop through the layers of the map using the layer index and look for the layer name. If you need to compare the featureclass name and get the featureclass from the featurelayer. Cheers
... View more
06-18-2012
07:21 AM
|
0
|
0
|
1948
|
|
POST
|
what controls do you have on the dockable window? Do these controls reference assemblies not on the target? Do you have exception handling on all your events in the dockable window? If so you should be able to handle the exception and write out the message.
... View more
05-31-2012
01:17 PM
|
0
|
0
|
924
|
|
POST
|
On the development machine, do you have an ArcGIS Engine developer license?
... View more
05-25-2012
07:43 AM
|
0
|
0
|
1013
|
|
POST
|
Please mark the issue as answered if the problem is solved
... View more
05-24-2012
12:05 PM
|
0
|
0
|
944
|
|
POST
|
Based on what you said about the tool, I would recommend using store instead of updatefeature and I would also recommend creating the feature and setting the values within the same edit operation. This will create and set the values all in one operation and will trigger the appropriate events that the different components of the editor extension and custom extension are expecting. UpdateFeatures short-circuits the events, making faster for bulk updates but components relying on events won't work. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Creating_features/00010000049v000000/
... View more
05-24-2012
10:47 AM
|
0
|
0
|
944
|
|
POST
|
There is nothing wrong with editing the default version. It would be ill advised if you have many (>5) users doing it at the same time. There are many other circumstances where that would not be good, but, in some cases, that is a perfectly legitimate thing to do.
... View more
05-23-2012
05:36 AM
|
0
|
0
|
1928
|
|
POST
|
sr locks are schema locks. So just opening the shapefile will create a schema lock no edits necessary. You need to explicitly release any references to the featureclass and workspace using the comreleaser. It is a bit of a needle in a hay stack to find them all though. It is the only way I know how to do it. I remember once having to wade through thousands of lines of code to do it, the only way was to set break points, monitor the locks and comment out section by section of code. Good luck
... View more
05-23-2012
04:55 AM
|
0
|
0
|
494
|
|
POST
|
You can't install just arccatalog, you have to install desktop. CatalogUI is specific to ArcGIS desktop and cannot be used in pure engine applications. This is deliberate since ui classes such as forms have windows dependencies and engine is designed to work on non-windows platforms as well windows. Any redistribution of esri dlls would a. be a hack, b. probably in violation or license agreements, c. would need redistribution of the com dll not just the .net wrapper and any other dll that this dll depends on and d. subject to fail at any update of arcgis version or service pack.
... View more
05-22-2012
01:40 PM
|
0
|
0
|
856
|
|
POST
|
The code provided by Ken is vb.net not vba, so for a c# add-in it is the same just with a c# syntax http://www.harding.edu/fmccown/vbnet_csharp_comparison.html if this is a not an add-in and is a tool inheriting basetool, you just have to override the Enabled property of the basetool and put whatever code you need in there as long as it returns true or false. Hint, don't put code too elaborate in the enabled property because it runs basically all the time (ie on mouse move.) If the tools or commands need to talk to notify each other, I suggest adding an extension to the mix and setting and reading values on the extension. There can be more than one instance of a command or tool in arcmap which will lead to confusion over where the value is set. There can only be one extension with the same classid loaded at one time making a unique repository for values that need to be passed around.
... View more
05-22-2012
01:17 PM
|
0
|
0
|
3281
|
|
POST
|
Do/undo is a property of the editor that you set in the mxd. Basically with do/undo you must have versioning, without you can edit un-versioned data. This could explain why it works for some add-ins and not others (the mxd being the difference.) As a test, I wonder what would happen if you loaded an editable feature class as a layer in the map. Another thing is you check if the editor is in the edit state before starting but there are three states, editing, not editing and editing but unfocused (active map is not the map where the edit session started.) Your code does not account for the unfocused state, maybe something to look at. Also it would be interesting to see if you can open a featureclass from the workspace before starting edit to see if it is working correctly.
... View more
05-22-2012
01:06 PM
|
0
|
0
|
1928
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-02-2024 10:26 AM | |
| 1 | 07-05-2024 08:45 AM | |
| 1 | 10-05-2022 02:19 PM | |
| 6 | 03-27-2017 01:16 PM | |
| 1 | 05-05-2016 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-28-2025
07:37 AM
|