Sample - Autotext Elements

Version 3

    Versions: 9.3.1 - current

    Product Availability: ArcFM Desktop


    The autotext element object is a component that implements IElement (see ArcObjects documentation), and handles configuration, drawing, and persistence. It is aware of a custom autotext source, which provides it with the text to display. The source component is responsible for refreshing its data when appropriate. You can write custom text source objects that programmatically provide event-specific text to an autotext element. Autotext elements use the IMMAutoTextSource and IMMAutoTextSourceSymbol interfaces.

     

    This developer sample contains several types of Autotext Elements:

    • Adjacent Grid: Locates the map grids adjacent to the grid currently being plotted and displays the value in their Primary Display Field.
    • Page Number: Adds a page number in the following format: Page X of Y, where Y is equal to the number of plots. If any of the plots have multiple pages, Y will be incorrect.
    • Current Date: Inserts the current date. The format is dictated by your computer settings.
    • Map Production Primary Display Field: Enters the primary display field of the layer selected in the Map Set Features field on the ArcFM Map Production window.
    • User Name: Enters the login name of the user currently logged in to ArcMap.

     

    How to Implement:

    You do not need to build the solution because the autotext elements this project creates are already in the ArcFM application. If you do build, the solution will output a Miner.Samples.AutoText.dll file.


    Requires:

    All of the files shown below are required for the project to compile successfully.

     

    FileDescription
    Miner.Samples.AutoText.csprojC# project containing the code to generate a custom autotext element.
    AdjacentGrid.csThis class module gets the selected Map Grid ID and displays the corresponding Map Grid IDs for the adjacent grids.
    AdjacentE.csThis class module provides the map grid ID of the grid adjacent to the selected grid's eastern edge.
    AdjacentN.csThis class module provides the map grid ID of the grid adjacent to the selected grid's northern edge.
    AdjacentNE.csThis class module provides the map grid ID of the grid adjacent to the selected grid's northeastern edge.
    AdjacentNW.csThis class module provides the map grid ID of the grid adjacent to the selected grid's northwestern edge.
    AdjacentS.csThis class module provides the map grid ID of the grid adjacent to the selected grid's southern edge.
    AdjacentSE.csThis class module provides the map grid ID of the grid adjacent to the selected grid's southeastern edge.
    AdjacentSW.csThis class module provides the map grid ID of the grid adjacent to the selected grid's southwestern edge.
    AdjacentW.csThis class module provides the map grid ID of the grid adjacent to the selected grid's western edge.
    AutoPageNumber.csAdds a page number in the following format: Page X of Y. Y is equal to the number of plots. If any of the plots have multiple pages, Y will be incorrect.
    AutoTextDate.csInserts the current date. The format is dictated by your computer settings.
    MapGridID.csEnters the primary display field of the layer selected in the Map Set Features field on the ArcFM Map Production window.
    UserName.csEnters the login name of the user currently logged in to ArcMap.
    AssemblyInfo.csClass module to support the autotext element.