-
So far, I can use getElementProps(elementId) to return information which contains a hexadecimal string representing the Category ID of an element. I presumed that this hexadecimal ID would be the same as the ECInstanceID from the bis.category schema, and to get the name of the category you could use the query: "SELECT codeValue FROM bis.category WHERE ECInstanceID='hexadecimal ID'. This seems to be the wrong approach, as the bis.category has no instances where the ECInstanceID is equal to the Category ID from a given element. What would be the standard way of obtaining the name of the category for a given element? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I don't see what you're doing wrong. The value of the category member is the ElementId (aka ECInstanceId) of the Category element. Your query should find it, and its codevalue is its name. How did you determine that there are no elements with that id? I note that in this.iModel.elements.getElement(this.category).getDisplayLabel() To get the "user friendly" name of the category, if one exists. HTH |
Beta Was this translation helpful? Give feedback.
-
You've enclosed your ID in |
Beta Was this translation helpful? Give feedback.
You've enclosed your ID in
'quotes'
. An ID is an integer, not a string. Remove the quotes and it will work.