Versions: 10.0.1 - 10.1
Product Availability: ArcFM Desktop
This code sample provides three components that may be used with Map Production. Use these three components in conjunction with each other to reshape map grids in a strip map series so that the overlapping map grids are clipped at the user-placed matchline to be adjacent with one another.
- MapSheetAngleSetter attribute autoupdater: This AU sets the angle field of a map grid feature class equal to the angle of the longest, northern most side.
- MatchLineETask edit task: When the user places a matchline, this edit task ensures it is placed within the overlap of two map grid features, then places the matchline. If the matchline is NOT within the overlap of two map grid features, it will not be placed. Note: When placing the matchline, the edit task will fail if the line is 270° or 90°.
- MatchLineCutsGrids special autoupdater: Once the matchline has been placed and verified to be in the overlapped area, this AU programmatically extends it to the edges of the overlapped map grids, then cuts the overlap and joins the map grids at the matchline.
How to Implement:
- You may modify the code sample. This step is not required.
- Compile the code sample.
When using custom tools that work with Map Production, it is important to note that C# code that uses event handlers to listen to Map Production events must provide a handler for all event procedures or ArcMap will crash when any of those events are fired.
How to Configure:
- In ArcCatalog, assign the ArcFMMapGrid model name to the Map Grid feature class (Model Names tab in the ArcFM Properties Manager). If this name isn't available in the ArcFM Properties Manager, you may need to add it to a domain (see Configuring ArcFM Solution online help).
- Ensure the Map Grid feature class has an Angle field with a Data Type of Double.
- Create a MatchLine feature class with a Geometry Type of "Line Features". Once this feature layer is created, it must be converted to an ArcFM Object using the ArcFM Solution Object Converter in ArcCatalog.
- In ArcCatalog, assign the Sample Create ArcFM MatchLine (.NET) edit task to the MatchLine feature class (Create Edit Task field on the Object Info tab of the ArcFM Properties Manager). Click Apply.
- In ArcCatalog, assign the Sample ArcFM MatchLine Splits MapGrids (.NET) autoupdater to the On Feature Create event of the MatchLine feature class. (On Feature Create field on the Object Info tab of the ArcFM Properties Manager). Click Apply and close the ArcFM Properties Manager.
- In ArcCatalog, right click the MapGrid feature class and select ArcFM Properties Manager.
- Assign the Sample ArcFM MapSheet Angle Setter (.NET) attribute autoupdater to the On Feature Create event of the Angle field on the MapGrid feature class. Click Apply and close the ArcFM Properties Manager.
How to Use:
- In ArcMap open a stored display and add the MatchLine and MapGrid feature classes to the map.
- Start an edit session.
- Ensure the MapGrid and MatchLine feature classes exist in your map. If not, add them.
- Use the Map Grid Generator to place a few map grids that overlap.
- Place a MatchLine feature inside the overlap. The feature must start and end within the overlap area. Note that when you select the MatchLine feature class in the Features pane, the Task (on the Editor toolbar) is set to Sample Create ArcFM MatchLine (.NET).
- The map grid overlap will be split along the match line and the map grids redrawn.
All of the files shown below are required for the solution to build successfully.
|MapProductionSupportTools.csproj||C# project containing the code to generate custom Map Production support tools.|
|MapSheetAngleSetter.cs||This attribute autoupdater sets the angle field of a map grid feature class to equal the angle of the longest, northern most side.|
|MatchLineCutsGrids.cs||This special autoupdater reshapes overlapping polygons to be adjacent at a digitized two-point MatchLine feature.|
|MatchLineETask.cs||This edit task validates that a matchline is digitized within the intersection of two adjacent map grid features.|