Posts Tagged ‘vba’

The ESRI UC ArcGIS 10 Q&A Response Is Up (James Fee)

Friday, July 9th, 2010

jmf-where20-2009-sidebar[Editor's note: As the GIS community prepares for the just released ArcGIS 10 and gathers for the annual User Conference in San Diego, Ezree cum E.S.R.I. has posted a Question and Answer FAQ about the new release. Notable to me: Visual Basic for Applications (VBA) is resurrected for the last time, time to learn Python! James Fee translates from corporate speak.]

Republished from Spatially Adjusted.

One of the best insights into ESRI and their direction is the UC Q&A. ESRI has posted the latest one here and some highlights are below:

Q: What has ESRI done in the area of map books?

A: At ArcGIS 10, functionality has been added to allow you to create map books using a feature layer to define map extents for multiple pages. This new functionality, in conjunction with all the other enhancements to support map books, is referred to as data driven pages. Data driven pages give you the ability to generate multiple pages by taking a single layout and iterating over a set of map extents. Any feature layer, point, line or polygon can be used, along with a margin, to define the extents.

A question I still get asked again and again is when is ESRI going to update DS Mapbook. Well now you’ve got a real solution built into ArcGIS 10.

Q: Does ArcGIS 10 open up more functionality for use with Python?

A: Python integration is one of the key features of ArcGIS 10. At this release we’ve introduced a new Python subsystem called ArcPy, which exposes many of the ArcGIS functions.

ArcPy is still a little kludgy, but wasn’t isn’t with ArcGIS 10.

Continue reading at Spatially Adjusted . . .

Scriptopedia: JS, AS, and VBA scripts for Create Suite apps

Tuesday, February 9th, 2010

titre

[Editor's note: New script compendium. Some for Illustrator, many for InDesign.]

Republished from Scriptopedia.

Eddy and I are very pleased to announce the release of the scripts library for the Adobe Software and desktop publishing and photography.
Pointing out the dispersion of the scripts over the Internet, we have decided to offer a unique space gathering the best in the automation field.

Javascript, Applescript, VisualBasic or action scripts will be warmly hosted here.

If you want to make part of this adventure and help us filling the base, don’t hesitate and contact us !

We hope you enjoy surfing on this site and using the scripts as much as we had creating Scriptopedia.org.

Thanks in advance and…

Check out Scriptopedia . . .

VBA Field Calculator Tips in ArcMap (Kelso)

Tuesday, November 24th, 2009

fieldcalculator2I’ve been relying on the Advanced logic options in ArcMap’s Field Calculator to wrap up Natural Earth Vector. Because of the diacritical (accent) marks present on many placenames around the world, care must be taken to ensure they don’t get corrupted.

With basic SHP files, I often edit thematic data in Excel and then join it back with the SHP. However, Excel mangles diacritical marks, especially if you’re going cross platform between the Mac and PC. Even when everything is setup right, ArcMap the get Info panel displays ? marks for many diacriticals. The attributes table view shows them correctly, though.

Much of the base data and name attributes are compiled in Adobe Illustrator and exported with MaPublisher using custom scripts I’ve written to take the name from the text that’s been grouped with the feature. This allows contributors who don’t have ArcGIS at home or in the office to take part in the project. Because we often have other attributes (maybe a second name, scale rank, type of feature), I use an “_” underscore character to concatenate these into one string. This string then needs to be parsed back into separate attribute columns.

Note: SHP files use Windows 1252 character encoding. If you’re on a Mac, change your MP export options from “System” to that. If you’re on a PC, you’re already good.

Splitting strings:

In VBA prelogic area (advanced checkmark on):

myString = [ColumnName]
myPosition = InStr(myString , “_”)
myLeft = myPosition – 1

myLen = Len(myString)
myRight = myLen – myPosition
country = Left( myString, myLeft )
provNumber = Right( myString, myRight )

In the field results area: provNumber or country.

Note: If the result is destined for a number formatted column, either caste provNumber as a number or use a temporary holding column that is string formatted, then rerun the field calculator on the number formatted column deriving the value from the temp field. ArcMap with auto-caste for you in that case.

After the jump: Find and replace, counting substrings, hit tests, and changing case.

(more…)