Monday, January 26, 2009

Extract 3DPolyline From Corridor

This post will show how to extract all of the feature lines from a corridor with a particular code name using VBA programming. Well it won't do all of them, just the ones associated with the Mainline baseline (any offset baselines are not dealt with).


The user is prompted to select a corridor and then to type in the code they want to extract. As you can see in the code each of the baselines, feature line collections and feature lines are looped through to see if they contain contain the code the user provided. At the end a 3DPolyline is added to the drawing and then it loops to the next items. The basic structure for offset baselines is similar and could be added. The completed code may be found on this page:

There is no error catching in the code, so the user will get error messages if something goes wrong. Adding On Error Resume Next near the top of the code will suppress most of the error messages.

No comments:


Blog Widget by LinkWithin