The following Python window script demonstrates how to use the ApplyBuildingOffsets function to align, move, and hide building marker symbols based on the MGCP XML rule file.
# Name: ApplyBuildingOffsets_sample.py
# Description: This script tool aligns, moves, and hides building marker symbols based
# on product specification rules defined in a rule xml file
# Import System Modules
import arcpy
# Check Out Extensions
arcpy.CheckOutExtension('Foundation')
# Setting the environment
arcpy.env.overwriteOutput = 1
# Setting Local Variables
in_map = r'C:\Data\MGCP_TRD_4_4.mapx'
rule_file = r'C:\Data\MTM50_TRD_4_4_BuildingOffsets.xml'
# Calling the Apply Building Offsets tool to align, move, and hide building marker symbols based
# on product specification rules defined in a rule xml file
arcpy.topographic.ApplyBuildingOffsets(in_map, rule_file)
# Getting all messages, warnings, and errors from the tool run and printing the results back to the user
messages = arcpy.GetMessages(0)
warnings = arcpy.GetMessages(1)
errors = arcpy.GetMessages(2)
arcpy.AddMessage('Tool Messages: {}\nTool Warnings: {}\nTool Errors{}\n'.format(messages, warnings, errors))
# Check In Extensions
arcpy.CheckInExtension('Foundation')