|
POST
|
Well got this script to work, but it wasnt using the tips from above... One of error messages related to 'Layer 0', and I noticed that the problem seemed to occur (in this particular isntance) to a shapefile I had half way down in my TOC, so I dragged the shapefile to the top of my TOC, and ran the macro again, and it worked. I have tested this with another project, and it only seems to work when the shapefile is first in the TOC. It's not something we will use everyday, so this solution will do for now! Dan That's because your code is written to operate on the first layer in the TOC. Set pGeoLayer = pMap.Layer(0)
... View more
01-25-2013
04:45 AM
|
0
|
0
|
734
|
|
POST
|
The way that will always work is to query for all of the features, loop through them and look for the min and max values. You can also use IDatastatistics. Depending on the datasource, you could use a standard SQL query to get the min and max. Keep in mind though that the OIDs may not be sequential. There could be gaps caused by deleting features and other operations. A feature class could have a feature with OID 1 and another feature with OID 1000 and only have 2 features in it.
... View more
01-25-2013
04:43 AM
|
0
|
0
|
472
|
|
POST
|
Oh, you're talking about an addin. I don't think there's any way but to clear the list and add the items back like you said. As far as I know, the underlying combobox control isn't exposed. If you were implementing the old style command/toolcontrol then you could expose the underlying combobox and get access to all of its properties and methods.
... View more
01-24-2013
07:41 AM
|
0
|
0
|
1310
|
|
POST
|
You could call Remove or RemoveAt to remove the item from the list then call Insert to add it back at the desired index position.
... View more
01-24-2013
06:44 AM
|
0
|
0
|
1310
|
|
POST
|
You would need to stop the feedback and get the polyline object it returns. Restart the feedback, QI over to IPointCollection and add all of the points except for the last one back to it. After that, call MoveTo and pass in the current mouse location to connect the feedback back to the mouse cursor.
... View more
01-24-2013
04:36 AM
|
0
|
0
|
496
|
|
POST
|
The Using statement scopes the resource (the variable you declare) to the block of code between the Using and End Using statements. The purpose of the Using statement is to limit the scope of a resource within a larger block of code and to guarantee that it is disposed as soon as the End Using statement is executed. So, is it ok to nest Using statements? Yes. It's really no different than nesting loops or If/End If blocks. In your case, you're using a cursor within a loop. Each loop iteration opens a new cursor. That cursor needs to be released with each loop iteration. Each time a cursor is created, a table in the database is opened. It will not be closed until the cursor is released, so if you don't release the cursor within each loop iteration it will keep opening tables and not closing them. Eventually, you'll hit the max. number of open tables and an exception will be thrown. So, that cursor needs to be managed by its own ComReleaser object declared within the loop. If you use the ComRelease declared outside of the loop then the cursors created inside the loop will not be released until after the loop is exited.
... View more
01-24-2013
04:30 AM
|
0
|
0
|
3288
|
|
POST
|
IMO, the best practice is not to use ESRI's ComReleaser class at all. The best way to manage your COM objects is to do it yourself so that you know what's going on and have full control over it. When looping through a cursor, you should also be releasing the row/feature objects within the loop before assigning the reference to the next item in the cursor. 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.ReleaseComObject(feature)
feature = featureCursor.NextFeature
Loop
Marshal.ReleaseComObject(featureCursor)
... View more
01-23-2013
06:25 AM
|
0
|
0
|
3288
|
|
POST
|
Have you tried modifying the geometry used by the text path (ITextPath.Geometry)?
... View more
01-21-2013
12:15 PM
|
0
|
0
|
1719
|
|
POST
|
Sorry, I was thinking the map title was a type of text element but it isn't. You might try using a standard text element instead of a map title.
... View more
01-21-2013
05:00 AM
|
0
|
0
|
1095
|
|
POST
|
Try positioning the element with a point geometry instead of an envelope. You can set the horizontal and vertical alignment properties on the element so that it aligns itself on the point the way you want it to.
... View more
01-21-2013
04:08 AM
|
0
|
0
|
1095
|
|
POST
|
At the top of this page, click Help. What you're looking for is under the Developer Help section.
... View more
01-10-2013
04:13 AM
|
0
|
0
|
381
|
|
POST
|
It's been a really, really long time since I've worked with address locators and I may be wrong but I don't think your code is doing what you think it's doing. I believe the MatchAddress method is simply returning a property set that contains the geocoded address that you're trying to match. In other words, you're passing in the address you want to match ("search for" might be a better description) in pieces and it puts them together into the standardized format defined by the locator you're using. If you want the actual results of the search then I think you need to be using the IAddressCandidates interface and calling the FindAddressCandidates method.
... View more
01-08-2013
10:03 AM
|
0
|
0
|
1097
|
|
POST
|
I don't know how to explain it other than to repeat what I've already said. The OpenDocument event fires when a document is opened. Inside this event, you are calling your form. You cannot close ArcMap or load another document from this form because ArcMap is already in the process of opening a document. I have tested this and each time I try it I get an Access Denied error. If you want to close ArcMap or load another document then you will have to do it from somewhere other than the OpenDocument event. Also, ArcObjects is not a language. The language you are using is VBA. It's important to tell others this when asking a question because the vast majority of the people on this forum do not use VBA. They use a .NET language, C++ or Java. How you do things can vary greatly depending on your programming environment so telling people what environment you're using will get you a correct answer much faster.
... View more
01-07-2013
10:31 AM
|
0
|
0
|
803
|
|
POST
|
No, that is not correct. First, you should have stated that you're using VBA to begin with so that someone trying to answer your question would know what environment you're working in. As I said in my last post, VBA has a built-in shortcut named Application. So the code would be: Application.Shutdown() However, since you're calling your form from ArcMap's OpenDocument event you will not be able to close ArcMap or load another document because ArcMap is already in the process of opening a document. You can only do these kind of things after the document has been loaded.
... View more
01-07-2013
09:44 AM
|
0
|
0
|
1218
|
|
POST
|
You always have a way to get a reference to the ArcMap application. If you're implementing an extension then it's passed into the Startup method. If you're implementing a command or tool then it's passed into the Create method. Addins have something similar but I don't work with them so I don't know it off the top of my head. In VBA, it's a built-in environment shortcut named Application.
... View more
01-07-2013
09:17 AM
|
0
|
0
|
1218
|
| 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
|