IModelConnection Namespace

Class

Name Description
IModelConnection.CodeSpecs The collection of CodeSpec entities for an IModelConnection.
IModelConnection.Elements The collection of Elements for an IModelConnection.
IModelConnection.Models The collection of loaded ModelState objects for an IModelConnection.
IModelConnection.Views The collection of views for an IModelConnection.

Interface

Name Description
IModelConnection.GetPlacementsOptions Options controlling the results produced by IModelConnection.Elements.getPlacements.
IModelConnection.ViewSpec The id/name/class of a ViewDefinition.

Defined in

IModelConnection Class

A connection to a IModelDb hosted on the backend.

extensions

Extends

Extended by

Methods

Name Description
cartographicToSpatial(cartographic: Cartographic, result?: Point3d): Promise<Point3d> Convert a Cartographic to a point in this iModel's Spatial coordinates using the Geographic location services for this IModelConnection or ecefLocation.  
cartographicToSpatialFromGcs(cartographic: Cartographic, result?: Point3d): Promise<Point3d> Convert a Cartographic to a point in this iModel's Spatial coordinates using the Geographic location services for this IModelConnection.  
close(): Promise<void> Abstract Close this IModelConnection.  
createQueryReader(ecsql: string, params?: QueryBinder, config?: QueryOptions): ECSqlReader Allow to execute query and read results along with meta data. Beta  
expandDisplayedExtents(range: Range3d): void Expand this iModel's IModelConnection.displayedExtents to include the specified range.  
findClassFor<T extends undefined>(className: string, defaultClass: undefined | T): Promise<undefined | T> Find the first registered base class of the given EntityState className.  
getGeometryContainment(requestProps: GeometryContainmentRequestProps): Promise<GeometryContainmentResponseProps> Request element clip containment status from the backend.  
getGeometrySummary(requestProps: GeometrySummaryRequestProps): Promise<string> Obtain a summary of the geometry belonging to one or more GeometricElements suitable for debugging and diagnostics.  
getMassProperties(requestProps: MassPropertiesRequestProps): Promise<MassPropertiesResponseProps> Request element mass properties from the backend.  
getMassPropertiesPerCandidate(requestProps: MassPropertiesPerCandidateRequestProps): Promise<MassPropertiesPerCandidateResponseProps[]> Request mass properties for multiple elements from the backend.  
getToolTipMessage(id: string): Promise<string[]> Request a tooltip from the backend.  
isBlankConnection(): this is BlankConnection Type guard for instanceof BlankConnection  
isBriefcaseConnection(): this is BriefcaseConnection Type guard for instanceof BriefcaseConnection  
isCheckpointConnection(): this is CheckpointConnection Type guard for instanceof CheckpointConnection Beta  
isSnapshotConnection(): this is SnapshotConnection Type guard for instanceof SnapshotConnection  
loadFontMap(): Promise<FontMap> Load the FontMap for this IModelConnection.  
query(ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> Execute a query and stream its results  
queryEntityIds(params: EntityQueryParams): Promise<Id64Set> Query for a set of element ids that satisfy the supplied query params  
queryRowCount(ecsql: string, params?: QueryBinder): Promise<number> Compute number of rows that would be returned by the ECSQL.  
queryTextureData(textureLoadProps: TextureLoadProps): Promise<undefined | TextureData> Request a named texture image from the backend.  
restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any> Cancel any previous query with same token and run execute the current specified query.  
spatialToCartographic(spatial: Readonly<WritableXYAndZ>, result?: Cartographic): Promise<Cartographic> Convert a point in this iModel's Spatial coordinates to a Cartographic using the Geographic location services for this IModelConnection or ecefLocation.  
spatialToCartographicFromGcs(spatial: Readonly<WritableXYAndZ>, result?: Cartographic): Promise<Cartographic> Convert a point in this iModel's Spatial coordinates to a Cartographic using the Geographic location services for this IModelConnection.  

Inherited methods

Name Inherited from Description
cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d): Point3d IModel Convert a Cartographic to a point in this iModel's Spatial coordinates using its ecefLocation.
ecefToSpatial(ecef: Readonly<WritableXYAndZ>, result?: Point3d): Point3d IModel Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its ecefLocation.
getEcefTransform(): Transform IModel Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its ecefLocation.
getRpcProps(): IModelRpcProps IModel Return a token for RPC operations.
setEcefLocation(ecef: EcefLocationProps): void IModel Set the EcefLocation for this iModel.
setGeographicCoordinateSystem(geoCRS: GeographicCRSProps): void IModel Sets the geographic coordinate reference system from GeographicCRSProps.
spatialToCartographicFromEcef(spatial: Readonly<WritableXYAndZ>, result?: Cartographic): Cartographic IModel Convert a point in this iModel's Spatial coordinates to a Cartographic using its ecefLocation.
spatialToEcef(spatial: Readonly<WritableXYAndZ>, result?: Point3d): Point3d IModel Convert a point in this iModel's Spatial coordinates to an ECEF point using its ecefLocation.
getDefaultSubCategoryId(categoryId: string): string Static IModel Get the default subCategoryId for the supplied categoryId

Properties

Name Type Description
codeSpecs Readonly IModelConnection.CodeSpecs The CodeSpecs in this IModelConnection.  
connectionTimeout Static number The maximum time (in milliseconds) to wait before timing out the request to open a connection to a new iModel  
displayedExtents Readonly Range3d The displayed extents of this iModel, initialized to IModel.projectExtents.  
elements Readonly IModelConnection.Elements The ElementStates in this IModelConnection.  
fontMap undefined | FontMap The font map for this IModelConnection.  
hilited Readonly HiliteSet The set of currently hilited elements for this IModelConnection.  
isBlank Accessor ReadOnly boolean True if this is a Blank Connection.  
isBriefcase Accessor ReadOnly boolean Returns true if this is a briefcase copy of an iModel that is synchronized with iModelHub.  
isClosed Accessor AbstractReadOnly boolean Check if the IModelConnection is closed (i.e.  
isOpen Accessor ReadOnly boolean Check if the IModelConnection is open (i.e.  
isReadonly Accessor ReadOnly boolean Check the IModelConnection.openMode of this IModelConnection to see if it was opened read-only.  
isSnapshot Accessor ReadOnly boolean Returns true if this is a snapshot iModel.  
models Readonly IModelConnection.Models The ModelStates in this IModelConnection.  
onClose Readonly BeEvent<(_imodel: IModelConnection) => void> Event called immediately before this IModelConnection is closed.  
onClose StaticReadonly BeEvent<(_imodel: IModelConnection) => void> Event called immediately before any IModelConnection is closed.  
onOpen StaticReadonly BeEvent<(_imodel: IModelConnection) => void> Event called immediately after any IModelConnection is opened.  
routingContext IModelRoutingContext The RPC routing for this connection.  
selectionSet Readonly SelectionSet The set of currently selected elements for this IModelConnection.  
tiles Readonly Tiles The set of Tiles for this IModelConnection.  
transientIds Readonly TransientIdSequence Generator for unique Ids of transient graphics for this IModelConnection.  
views Readonly IModelConnection.Views The ViewStates in this IModelConnection.  

Inherited properties

Name Type Inherited from Description
_openMode Protected OpenMode IModel  
changeset ChangesetIdWithIndex IModel  
dictionaryId StaticReadonly string IModel The Id of the dictionary model.
ecefLocation Accessor undefined | EcefLocation IModel The EcefLocation of the iModel in Earth Centered Earth Fixed coordinates.
If the iModel property geographicCoordinateSystem is not defined then the ecefLocation provides a geolocation by defining a
3D coordinate system relative to the Earth model WGS84. Refer to additional documentation for details. If the geographicCoordinateSystem
property is defined then the ecefLocation must be used with care. When the geographicCoordinateSystem is defined it indicates the
iModel cartesian space is the result of a cartographic projection. This implies a flattening of the Earth surface process that
results in scale, angular or area distortion. The ecefLocation is then an approximation calculated at the center of the project extent.
If the project is more than 2 kilometer in size, the ecefLocation may represent a poor approximation of the effective
cartographic projection used and a linear transformation should then be calculated at the exact origin of the data
it must position.
geographicCoordinateSystem Accessor undefined | GeographicCRS IModel The geographic coordinate reference system of the iModel.
globalOrigin Accessor Point3d IModel An offset to be applied to all spatial coordinates.
iModelId Accessor ReadOnly undefined | string IModel The Guid that identifies this iModel.
isGeoLocated Accessor ReadOnly boolean IModel True if this iModel has an EcefLocation.
iTwinId Accessor ReadOnly undefined | string IModel The Guid that identifies the iTwin that owns this iModel.
key Accessor ReadOnly string IModel Get the key that was used to open this iModel. This is the value used for Rpc and Ipc communications.
name Accessor string IModel Name of the iModel
onEcefLocationChanged Readonly BeEvent<(previousLocation: undefined | EcefLocation) => void> IModel Event raised after ecefLocation changes.
onGeographicCoordinateSystemChanged Readonly BeEvent<(previousGCS: undefined | GeographicCRS) => void> IModel Event raised after geographicCoordinateSystem changes.
onGlobalOriginChanged Readonly BeEvent<(previousOrigin: Point3d) => void> IModel Event raised after globalOrigin changes.
onNameChanged Readonly BeEvent<(previousName: string) => void> IModel Event raised after name changes.
onProjectExtentsChanged Readonly BeEvent<(previousExtents: Range3d) => void> IModel Event raised after projectExtents changes.
onRootSubjectChanged Readonly BeEvent<(previousSubject: RootSubjectProps) => void> IModel Event raised after rootSubject changes.
openMode Accessor ReadOnly OpenMode IModel The OpenMode used for this IModel.
projectExtents Accessor Range3d IModel The volume, in spatial coordinates, inside which the entire project is contained.
repositoryModelId StaticReadonly string IModel The Id of the repository model.
rootSubject Accessor RootSubjectProps IModel The name and description of the root subject of this iModel
rootSubjectId StaticReadonly string IModel The Id of the root subject element.

Defined in

Last Updated: 20 May, 2022