Exercise 4: Configuring schematic attributes

Complejidad: Avanzado Requisito de datos: ArcGIS Tutorial Data for Desktop Ruta de los datos: C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data Objetivo: Learning about how to create and delete schematic attributes

In this exercise, you will become familiar with configuring schematic attributes. You will learn about how to do the following:

NotaNota:

Exercises 1 and 2 of the Schematics Advanced Configurations Tutorial are required for this exercise. You will be building on what was already configured in the previous exercises.

Edit the schematic dataset

Pasos:
  1. Open ArcCatalog.
  2. Browse to and select the schematics tutorial directory, C:\ArcGIS\ArcTutor\Schematics.
  3. Double-click the AdvancedSchematicDB geodatabase to expose the AdvancedSchematic schematic dataset that is inside.
  4. Right-click the AdvancedSchematic schematic dataset and choose Edit schematic dataset button Edit from the pop-up menu.

    This starts the Schematic Dataset Editor application.

  5. Select the BrazilTemplate diagram template in the Schematic Editor tree if it is not already selected and expand it so you see all the schematic feature classes underneath.

Creating a schematic attribute

Attributes are used for many things with Schematics including symbology, labeling, and advanced configuration items for connectivity and relationships.

Before making the decision to create an attribute in the configuration tool, you must decide if it is actually needed. With Schematics, there are a couple of options available depending on the need and the data:

This exercise will only give you a brief look at working with a couple of the attribute types. For more information on the other available attribute types, please consult the Managing schematic attributes help book.

For more information and an example of using attributes to define connectivity, please review Exercise 6 of the Schematics basic configurations tutorial.

Pasos:
  1. Right-click the pug_PUG_gas_plants schematic feature class in the Schematic Dataset Editor tree and choose New Attribute from the pop-up menu.

    A Properties tab for the new schematic attribute automatically displays on the right side of the Editor Window:

    New Schematic Attribute - Initial properties tab
    Attributes are not set until you do two things:
    • Click the OK button (this locks down the type of attribute).
    • Save (this actual creates the attribute in the system).

  2. Click OK.

    You should now see the NewAttribute entry in the Schematic Dataset Editor tree under pug_PUG_gas_plants.

    New Schematic Attribute - Final properties tab

Deleting an attribute

Notes about deleting an attribute

Pasos:
  1. Right-click the NewAttribute entry in the Schematic Dataset Editor tree and choose Delete icon Delete from the pop-up menu.

Create and configure an Associated Field type attribute

When you are working with schematic feature classes that have an associated object class (automatically set when you imported the .mxd in exercise 1), then Associated Field attributes are the most common. This allows you to select a field from the GIS feature class and basically add it to the schematic feature class. Then, for labeling or symbology, instead of creating a join in ArcMap like you did in a previous exercise, you can simply point to this field of your schematic layer. So you will do this for the NAME field of the pug_PUG_gas_plants schematic feature class, which is associated with the pug_PUG_gas_plants GIS feature class.

Pasos:
  1. Right-click the pug_PUG_gas_plants schematic feature class in the tree view and choose New Attribute from the pop-up menu.

    Associated Field is the default attribute type. This Type list is where you would pick different attribute types if needed. You will use that later in the exercise.

  2. Type GasPlantName in the Name field.

    • When the Storage Mode option is set to Field (as is the default), that means that a new field will be added to the schematic feature class. That field will have the name entered in the Name field—in this case, GasPlantName. The other Storage Modes are useful for other internal items or for information needed for a developer creating algorithms but should not be used if the intention is for end-user labeling and symbology, because you need to have a physical field.
    • Evaluation Mode—This is used to tell the system when to update the value that schematics is keeping track of. The default, On Generate\Update, means that this value is synchronized from the GIS feature to the schematic feature only during diagram generation or diagram update. If you choose On Start Editing, that will force the system to synchronize the value every time a user starts an edit session on the diagram. If you choose On Redraw/Refresh, it will cause the system to keep this synchronized all the time. Note that this On Redraw/Refresh should only be used in very specific cases, as it will have a performance impact on your diagram.

  3. Use the Field drop-down list to pick NAME from the list.

    This list displays all the GIS feature class fields available for pug_PUG_gas_plants.

    New Attribute _ GasPlantName

  4. Click OK to set this attribute.
  5. Create another Associated Field attribute to get the Rel_Electric field. You will use this in a minute as part of the definition for a Query attribute. Right-click the pug_PUG_gas_plants schematic feature class in the Schematic Dataset Editor tree and choose New Attribute from the pop-up menu.
  6. Type RelElecID in the Name field.
  7. Use the Field drop-down list to pick Rel_Electric from the list.

    New Attribute _ RelElecID

  8. Click OK.

Create and configure a Query type attribute

Pasos:
  1. Right-click the pug_PUG_gas_plants schematic feature class in the Schematic Dataset Editor tree and choose New Attribute from the pop-up menu.
  2. Type RelElecName in the Name field on the properties tab.
  3. Use the Type drop-down list to pick Query.

    New Attribute _ RelElecName phase1

  4. Click OK to set this attribute.

    In this version, the new Use Associated Feature Data Source has been added to the Query attribute type. If you are working with versioned data and you need to query another table based on the same version as each feature, then check this box. This will use the version that the related feature came from to then run the query. In previous versions that did not have this option, the query always ran against the Default version. If you are querying something in a different database, then do not check this box, as it will ignore the configuration and try to run the query using the same data source as the associated feature and won't be able to find the table you are trying to query. Since you are not in a versioned environment, there is no need to use this option. Now you need to configure the query.

  5. Click the Query/Identifier Editor button Query/Identifier Editor button in the Query section of the Properties tab.

    The Query/Identifier Editor dialog box opens.

  6. Use the Data Source drop-down list to pick Brazil.gdb, which is where the source data is located.

    This fills in the list of tables available in that data source.

  7. Use the Tables list to scroll, then double-click the pug_PUG_electric entry.

    This fills in a default query in the Query section.

    New Attribute _ RelElecName Tables
    Now you need to filter this query to return the record based on the gas plant in the user diagram. So you will get the row based on the objectID that is coming from your RelElecID attribute you defined above.

  8. Modify the query string by adding the following to the end of the existing string: where objectid = ?.

    This will open up a new Parameters section.

    New Attribute _ RelElecName Parameters

  9. Use the Name drop-down field in the Parameters section to choose RelElecID.
  10. Uncheck the Is Text check box, since this is a number.
  11. Type a test value of 1 in the Test Value field.
  12. Click the Show Results button in the Query section.

    This should show one row for the CAMACARI electric station in the Results section. You will need to scroll over to the name field to verify.

    New Attribute _ RelElecName Show Results

  13. Use the Identifier drop-down at the bottom of the form to choose NAME_.

    New Attribute _ RelElecName final
    You have told the system now that for each pug_PUG_gas_plant on a user's diagram, it will get the related electric station ID from an associated field attribute and run a query attribute against the pug_PUG_electric table to get the name of that electric station.

  14. Click OK to close the Query/Identifier Editor form.

Creating and configuring a Formatted Attribute

Formatted attributes let you combine multiple attributes and potentially add in text. You will combine two attributes for this example. You will put in the text so on a pug_PUG_gas_plant record, you will see something like Powered by electric plant number - electric plant name.

Pasos:
  1. Right-click the pug_PUG_gas_plants schematic feature class in the Schematic Dataset Editor tree and choose New Attribute from the pop-up menu.
  2. Type ElectricFormat in the Name field of the Properties tab.
  3. Pick Formatted from the Type drop-down list.

    New Schematic Attribute _ ElectricFormat

  4. In the format field, enter the following: Powered by %s - %s

    %s is a placeholder that allows you to pass in one of your other attributes. In this case, you want the related electric ID and name.

  5. In the Parameters grid, use the top drop-down list to pick RelElecID.
  6. In the Parameters grid, use the bottom drop-down list to pick RelElecName.

    ElectricFormat final

  7. Click OK to set this attribute.
  8. Click the Save button Save button icon on the Schematic Dataset Editor toolbar.
  9. Close the Schematic Dataset Editor.

Testing the attribute changes

Pasos:
  1. Open the Brazil.mxd file using ArcMap.

    This file is located in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\Mixed_Data.

  2. Use the ArcMap select tool to select everything in the current view.
  3. Click the Generate New Schematic Diagram button Generate New Schematic Diagram button icon on the Schematic toolbar.

    This opens the New Schematic Diagram dialog box.

  4. Click the browse button browse button icon next to the Schematic Dataset or Folder drop-down list.

    This opens the Select schematic dataset or schematic folder dialog box.

  5. Use this dialog box to browse to and select the AdvancedSchematic schematic dataset in the AdvancedSchematicDB geodatabase located at C:\ArcGIS\ArcTutor\Schematics.
  6. Click the Add button.

    Since your configuration only has one diagram template (BrazilTemplate), it is automatically selected in the Schematic Diagram Template section.

  7. Type TestAttributes in the Schematic Diagram Name text box.

    New Schematic Diagram - TestAttributes

  8. Click OK.

    You should see that the diagram has been laid out in a Hierarchical - Compact Tree layout, because that is what was set as the default for the diagram template. In the Schematic Editor toolbar, the Layout Task is also set to Hierarchical - Compact Tree.

    TestAttributes generated diagram

  9. Double-click the pug_PUG_gas_plants entry in the Table Of Contents that is found under the TestAttributes diagram layer.

    This opens the Layer Properties window.

  10. Click the Fields tab.
  11. Scroll down the fields list to see the new attributes created at the bottom of this list.

    Note that this is only because you specified that they would have a Storage Mode of Field.

    TestAttributes diagram _ Fields tab

  12. Click the Labels tab.
  13. Check the check box for Label features in this layer if it is not already checked.
  14. Use the drop-down list for Label Field to choose the SCH1E_pug_PUG_gas_plants.ElectricFormat field.

    TestAttributes diagram _ Labels tab

  15. Click OK.

    You should now see the gas plants with a label of Powered by1 - CAMACARI. Remember that this was created because of three different attributes (one Associated field for the electric plant number, one Query attribute for the electric plant name, and one formatted attribute to put them together).

    TestAttributes diagram _ with labels

  16. Close ArcMap and ArcCatalog and click No to any save dialog boxes.
9/11/2013