Hello Everyone
I am trying to create Expression Syntax Definitions to calculate Length, Width, Height (XYZ) when attaching item types to existing cells/elements.
So far ,XYZ values have been difficult to automatically define in item types.
https://communities.bentley.com/products/microstation/b/microstation_blog/posts/ec-expressions-in-item-types---new-in-microstation-connect-edition-update-12
The above link gives some handy information and a list of pdf syntax. However I cannot see anything suitable to generate XYZ data.
For example RAW dgn data shows the below for a cell:
Here is an example expression for volume
this.GetElement().GetDisplayValue("Volume")
Is it possible to do something similar with XZY values? Or use the RAW data (Range Low) minus (Range High)?
Thanks
Hi,
rold said:its having some issues with this expression this.GetElement().RangeLow.Z doesnt automatically update when the element has been changed or shortened in length.
can you share an example?
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Stuart,
Stuart Travis said:I am utilizing the XYZ range to calculate Length, Width, Height
You should be aware that the range does not expres real exact size of the element, so depending on context and required precision, the range can or cannot be used to calculate the size.
The range is a bounding box, expressed in integers in UORs (whereas graphic elements are stored using in double precision floating point numbers. So the range is alwyas slightly bigger than the element itself, but because it's done "at UOR level", the difference is typically very small.
Hi Jan, attach is a screen recording. I just made a cylinder and item type to report rangeLowZ. but as you can see in the video it doesnt automatically update
rold said:attach is a screen recording
Thanks, it is really descriptional
Regards,
Hello rold,
I noticed Stuart Travis's expression has a space char between RangeLow and .z. This space char is very important.
It seems a bug but in current version, it is important. I tested on coming MSCE-U17, this bug has fixed. with space or without space all work well.