# Mapping — transform attributes with rules

Applies configurable rules to 3D or IntelliPID objects during export. Use it to assign standard values, rename or remove attributes, or remove selected objects.

## Use

1. Install the plugin and its dependencies in a compatible Builder.
2. Create `UPVBPluginMapping.json` beside the first input session or in the installed plugin/helper directory.
3. Define 3D rules under `Mappings` and drawing rules under `MappingsIntelliPid`.
4. Export and check each rule's affected-element count in the log, then inspect representative output objects.

This example adds `Discipline=Piping` to objects already marked `Task=Piping`:

```json
{
  "ProcessOrder": 1,
  "Debug": false,
  "Mappings": [{
    "Name": "Classify piping",
    "ConditionCombineMode": "AND",
    "Conditions": [{"Type": "Text", "Key": "Task", "Value": "Piping"}],
    "Actions": [{"Type": "Set", "Key": "Discipline", "Value": "Piping"}]
  }],
  "MappingsIntelliPid": []
}
```

## Rule options

Conditions support `Text`, `Regex`, `Exist` and `NotExist`, combined using `AND` or `OR`. Actions support `Set`, `Delete`, `Rename`, `DeleteElement` and `RenameIdentifier`. For an attribute rename, `OldKey` identifies the source and `Key` the destination. Advanced mappings include inline value tables, regular expressions, functions, hashes and math; have those expressions reviewed for your specific data.

Rules run in sequence, so later rules can depend on earlier changes. Additional `.json` configurations in an `UPVBPluginMapping` folder beside the first session are appended. Avoid relying on the order of those separate files.

## Checks

`DeleteElement` removes objects from the export, and renaming identifiers can affect downstream references. Test those rules in a separate output. If no objects change, check attribute names, conditions and the loaded configuration path. An XML file with the same base name takes precedence over JSON in the same search directory.

[All solutions](UniversalPlantViewer.SDK.md)
