ItemType Expression Syntax Definitions

Is there a list of Item Expression Syntax Definitions available, there is a few in the help but I am guessing there is many more.

I am also looking for Examples of expressions using a calculation of Element Information (area, length etc.) with the values in other Item Properties in the same Item Type.

Below is an image showing what I am trying to achieve, I have been able to get the area value, but I can’t seem to get the syntax right for the Density value.

this.GetElement().Area/100000000*this.GetItem("Density").DoubleProp.

I have tried many combinations to get the Density Item Property value without success, any help would be greatly appreciated.

Regards,

John.

  • I can’t seem to get the syntax right for the Density value

    Interesting question.  Density is one of your Item Type properties, right?  Can you post a small DGN example?

     
    Regards, Jon Summers
    LA Solutions

  • Hi John,

    Try selecting element, go to Utilities > Named Expressions and in the Named Expressions dialog, go to Utilities > Report Symbols

    In the Expression Report that opens, the available expressions for this element with "this.GetElement()" should be listed under SelectedElement

    Not much documentation anywhere - found this out by accident...

    Regards,

    Mark


    OpenRoads Designer 2023  |  Microstation 2023.2  |  ProjectWise 2023

  • the available expressions for this element with "this.GetElement()" should be listed under SelectedElement

    Thanks for the tip!  The Named Expressions dialog is context-sensitive, and SelectedElement shows (in my web browser) only if an element is selected before one chooses that command.  Otherwise, one searches in vain.

     
    Regards, Jon Summers
    LA Solutions

  • Thanks Jon and Mark,

    I searched through the Named Expressions, but could not find anything on Items, and you are correct Jon, about selecting the element first, it then displays the attached Items but no indication of how to get the values.

    In the Qty Item Definition, I am wanting to get the value from the Density Item Definition and multiply it by the element area value which I am able to get ok, I just can't get the Density Value. The attached dgn file contains the Items as well as some example usages with labels. The #### shown in the labels should show the result of the expression in the Qty Item Definition. In the help provided in updfate 12, my guess indicates GetItemSameLibrary() this.GetItem("Lib1Itp1").DoubleProp would be the expression to use, but it just doesn't work for me.

    The Item Type I am working on is Planting>Plants, please ignore the others.

    Item Expression Test.dgn 

  • The Item Type I am working on is Planting>Plants

    The Expression that calculates your property Quantity is this:

    this.Density*this.GetElement().Area/100000000

    I've attached an updated version of your DGN file.

    Item Expression Test John Davidson.dgn

    Comments:

    • I had difficulty editing the text and fields in your notes (I'm unfamiliar with notes).  I created a new shape and annotated that with a normal text node element.  That text node displays several fields, including element Area, property Density and calculated property Quantity.
    • The Item Type Expressions UI is somewhat idiosyncratic.   It's not always clear whether a change has worked or not — the text fields don't always update immediately. 
    • When editing the element properties, it's not obvious that a value is calculated — the Qty field remains blank leading one to think that something is disconnected.

     
    Regards, Jon Summers
    LA Solutions