Add Labels to Arcade Script

The previous topic discussed adding labels to the Design Style. Now, you need to inform the arcade script of the same changes.

  1. Open the Design Style you created earlier in an application that can edit SQLite database files, such as DB Browser.

  2. Browse the data inside the Design Style, and locate the “meta” table.

  3. In the meta table, there are two rows where you configure the behavior of the Design Style: dictionary_configuration and dictionary_script.

  4. Click dictionary_configuration first.

  5. In previous examples, the “text” has been empty. Now, you populate it with all the Label Keys you included in the Design Style. Your text row varies depending upon what you included, but here is one example:

    {
      "configuration": [],
      "symbol": ["Type", "SpecType", "Energized", "ConductorType", "ConduitSystemType",
      "Phases", "ClosedPhases", "BreakerSubtype", "VoltageClass", "WorkflowState",
      "WorkFunction", "TransformerType", "DisconnectorSubtype", "PhaseCount",
      "Overloaded", "OpenPhases"],
      "text": ["Name", "RatedKVA", "Material", "Number", "Feeder"]
    }

  6. Save the changes.

  7. Now, click on the dictionary_script row in the meta table.

  8. The script depends on what you are trying to label and in what circumstances. Here is one example of labeling transformers and conductors:

    if (showLabels) {
          if($feature.Type == 'xfrb')
    	  {
    		 keys = keys + "label-ratedkva;";
    	  }
    	  else if($feature.Type == 'condb')
    	  {
    	      keys = keys + "label-material;label-feeder;";
    	  }
      }

  9. For more ideas about labeling, check out one of our samples. See Designer XI Samples for more information.

  10. Save your changes.

QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?