API Reference > imodeljs-backend > Codes > CodeSpecs CodeSpecs Class Manages CodeSpecs within an IModelDb Methods Name Description constructor(imodel: IModelDb): CodeSpecs getById(codeSpecId: Id64String): CodeSpec Look up a CodeSpec by Id. getByName(name: string): CodeSpec Look up a CodeSpec by name. hasId(codeSpecId: Id64String): boolean Returns true if the IModelDb has a CodeSpec of the specified Id. hasName(name: string): boolean Returns true if the IModelDb has a CodeSpec of the specified name. insert(codeSpec: CodeSpec): Id64String Add a new CodeSpec to the iModel. insert(name: string, scopeType: Type): Id64String Add a new CodeSpec to the IModelDb. load(id: Id64String): CodeSpec Load a CodeSpec from the iModel queryId(name: string): Id64String Look up the Id of the CodeSpec with the specified name. Defined in core/backend/src/CodeSpecs.ts Line 20 Last Updated: 13 June, 2024