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.
John Davidson said: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...
Mark
OpenRoads Designer 2023 | Microstation 2023.2 | ProjectWise 2023
Mark Shamoun said: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.
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
John Davidson said: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: