API Reference > imodeljs-backend > ViewDefinitions > ModelSelector > createCode createCode MethodStatic Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel. createCode(iModel: IModelDb, scopeModelId: string, codeValue: string): Code Parameter Type Description iModel IModelDb The IModelDb scopeModelId string The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name. codeValue string The ModelSelector name Returns - Code Defined in core/backend/src/ViewDefinition.ts Line 52 Last Updated: 11 June, 2024