I'm trying to get the total length (at 3 decimal point) from start station to end station of a component (say road pavement). So I had the following expression:
System.Math.Round(this.GetElement().GetDisplayValue("MeshSurfaceEntity_EndStation")-this.GetElement().GetDisplayValue("MeshSurfaceEntity_StartStation"),3)
However it failed to give me any value.
Would appreciate any Samaritan out there to see what's wrong with the expression and advise on a solution.
Thank you in advance.
Hi,
Does it work fine without the rounding function?
Regards,
Mark
OpenRoads Designer 2023 | Microstation 2023.2 | ProjectWise 2023
hi,
Tried the following expression scenarios.
System.Math.Round(this.GetElement().GetDisplayValue("MeshSurfaceEntity_EndStation") - this.GetElement().GetDisplayValue("MeshSurfaceEntity_StartStation"),3)
this.GetElement().GetDisplayValue("MeshSurfaceEntity_EndStation") - this.GetElement().GetDisplayValue("MeshSurfaceEntity_StartStation")
However I managed to get it to work by having the returned values from the this.GetElement().GetDisplayedValue(...) into a temp holder of defined value type (number) and using normal arithmetic on the holder values.
Not sure why that works but I suspect that it got something to the the type of value returned from the this.GetElement().GetDisplayedValue() function that don't with arithmetic or arithmetic functions (e.g. text)
Any idea what happen do share...
Hi, did you found any way how to do it?
Nope, still stuck with last year findings.
a... happens only one way which i found is that I create one property where is loaded values from this.GetElement or this GetDisplayValue and in other property i am doing rounding - but this generate many properties which are not usefull