# Combine Objects — merge related model objects

Combines objects with shared attribute values into larger selectable objects, for example a pipe run or structural group. The export replaces the selected source objects with combined objects, changing selection granularity and object identity.

## Use

1. Install the plugin and its dependencies in your compatible Builder.
2. Copy and adapt [UPVBPluginCombineObjects.xml](UPVBPluginCombineObjects/UPVBPluginCombineObjects/UPVBPluginCombineObjects.xml). Use that filename beside the first input session or in the installed plugin/helper directory.
3. Add a `CombineConfig` for each grouping rule, using the settings below.
4. Export to a separate output and inspect a few groups. Check the log's identified and combined counts.

| Setting | Purpose |
| --- | --- |
| `Name` | Identifies the rule in logs and output attributes. |
| `Condition` | Selects objects, for example `Task=Piping`. |
| `AttributesToGroupBy` | Lists the attributes whose values define each group. |
| `AspectName` | Names the output graphic aspect. |
| `ExecutionOrder` | Orders the grouping rules. |
| `ExcludeConditions` | Leaves matching objects out, such as valves or instruments. |
| `HierachyLevel` | Limits path-based grouping depth; preserve this exact spelling. |

For a pipe-run workflow, group `Task=Piping` by `PipeRun` and `NPD`, and use exclusions for components that must remain individually selectable. The repository includes project-specific examples; their attribute names may not exist in your model.

## Results and checks

Combined objects carry `CombineMappingKey`, `CombineConfig` and `CombineCount`. Do not assume conflicting source attributes or source object IDs will remain available individually. If nothing combines, check selection conditions, group attributes and the configuration path reported in the log. The supplied default contains active area-specific rules; replace them before use on another plant.

[All solutions](UniversalPlantViewer.SDK.md)
