insert MethodStatic


insert(txn, definitionModelId, name, defaultAppearance) @beta

Insert a new SpatialCategory

insert(txn: EditTxn, definitionModelId: string, name: string, defaultAppearance: SubCategoryAppearance | SubCategoryAppearance.Props): string

@returns The Id of the newly inserted SpatialCategory element.

@throws IModelError if unable to insert the element.

Parameter Type Description
txn EditTxn The EditTxn to use
definitionModelId string Insert the new SpatialCategory into this DefinitionModel
name string The name of the SpatialCategory
defaultAppearance SubCategoryAppearance | SubCategoryAppearance.Props The appearance settings to use for the default SubCategory of this SpatialCategory

Returns - string

The Id of the newly inserted SpatialCategory element.



insert(iModelDb, definitionModelId, name, defaultAppearance)

Deprecated  in 5.1.9 - will not be removed until after 2026-08-04. Use SpatialCategory.insert(txn, ...) instead.

Insert a new SpatialCategory

insert(iModelDb: IModelDb, definitionModelId: string, name: string, defaultAppearance: SubCategoryAppearance | SubCategoryAppearance.Props): string

Parameter Type Description
iModelDb IModelDb  
definitionModelId string  
name string  
defaultAppearance SubCategoryAppearance | SubCategoryAppearance.Props  

Returns - string


Defined in

Last Updated: 07 May, 2026