Question About Query SQL #7992
Answered
by
anmolshres98
zhang-zimin
asked this question in
Q&A
-
|
Hi all, If I want to retrieve all file or model names from an iModel, do you have any suggestions? |
Beta Was this translation helpful? Give feedback.
Answered by
anmolshres98
Apr 23, 2025
Replies: 1 comment
-
|
Hi, There are a couple of ways to do this depending on your context.
Note: If you use the ecsql query, the codeValue might be empty. In that case, we use this fallback logic to determine what the label should be: https://www.itwinjs.org/presentation/advanced/defaultbisrules/#label-overrides |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zhang-zimin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hi, There are a couple of ways to do this depending on your context.
useActiveIModelConneciton. You can iterate over all the models usingiModelConnection.models. Each item returned in the iterator returns aModelStateobject. This has anamefield that gives the value you are looking for. There is other data about the model that you might find useful as wellSELECT e.CodeValue from BisCore.Element e JOIN BisCore.PhysicalModel p on e.ECInstanceId = p.ECInstanceId. You can play around …