> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ploterr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Property sets

> Read and change the property sets of an element.

A property set is a named group of values on an element, such as a fire rating or a finish. Floorkit uses the common BIM naming style, for example `Pset_DoorCommon`. These functions read and change the property sets of an element.

## Import

```typescript theme={null}
import {
  getPropertySets,
  replacePropertySets,
  setPropertyValue,
  removePropertyValue,
  normalizePropertySets,
} from '@opengeometry/floorkit';
```

## Example

```typescript theme={null}
import { getPropertySets, setPropertyValue, type PropertySetOwner } from '@opengeometry/floorkit';

export function markFireRated(door: PropertySetOwner): void {
  setPropertyValue(door, 'Pset_DoorCommon', 'FireRating', 'EI30');
  console.log(getPropertySets(door));
}
```

## Notes

* A value is text, a number or a boolean.
* In a building model, write property sets in the `propertySets` field of an element. They are saved with the model.
* The functions return a result that tells you what changed.

## getPropertySets

Return a deep copy so host UI state cannot mutate the live model by reference.

```typescript theme={null}
function getPropertySets(owner: PropertySetOwner): PropertySets | undefined;
```

## replacePropertySets

Replace all named sets after validating and copying the supplied value.

```typescript theme={null}
function replacePropertySets(
  owner: PropertySetOwner,
  propertySets: unknown,
): PropertySetUpdateResult;
```

## setPropertyValue

Add or update one property in one named property set.

```typescript theme={null}
function setPropertyValue(
  owner: PropertySetOwner,
  propertySetName: string,
  propertyName: string,
  value: unknown,
): PropertySetUpdateResult;
```

## removePropertyValue

Remove one property, removing its set too when it becomes empty.

```typescript theme={null}
function removePropertyValue(
  owner: PropertySetOwner,
  propertySetName: string,
  propertyName: string,
): PropertySetUpdateResult;
```

## normalizePropertySets

Validate and deep-copy property sets.

```typescript theme={null}
function normalizePropertySets(value: unknown, path?: string): NormalizePropertySetsResult;
```

## Types

### PropertySetOwner

An element carrier or a direct owner such as a BuildingModel spatial scope.

```typescript theme={null}
type PropertySetOwner = PropertySetCarrier | HasPropertySets;
```

### PropertySetUpdateResult

```typescript theme={null}
interface PropertySetUpdateResult {
  warnings: PropertySetWarning[];
}
```

### NormalizePropertySetsResult

```typescript theme={null}
interface NormalizePropertySetsResult {
  propertySets: PropertySets | undefined;
  warnings: PropertySetWarning[];
}
```

### PropertySetCarrier

The structural contract used by host-app editing helpers.

```typescript theme={null}
interface PropertySetCarrier {
  propertySet: HasPropertySets;
}
```

### PropertySetWarning

```typescript theme={null}
interface PropertySetWarning {
  path: string;
  code:
    | 'invalid-property-sets'
    | 'invalid-property-set'
    | 'invalid-property-name'
    | 'invalid-property-value'
    | 'reserved-property-set';
  message: string;
}
```

## Related

* [`HasPropertySets`](/floorkit/api/architecture/op-element#haspropertysets)
* [`PropertySets`](/floorkit/api/architecture/op-element#propertysets)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.