Hi all,
I am trying to define an Item Type Point Type Property Definition by getting it to extract X, Y and Z values from another place.
Does anyone know how i can define a Point using expressions to populate its coordinates (if it is possible),
eg.
Mark Shamoun said:I am trying to define an Item Type Point Type Property Definition by getting it to extract X, Y and Z values from another place
What is the nature of 'another place'?
Regards, Jon Summers LA Solutions
Hi Jon,
The thought is it would be another Item Type property which is an adjusted value of one extracted from an element, eg. range.high - range.low / 2 to get an approx centroid of an element.
Regards,
Mark
OpenRoads Designer 2023 | Microstation 2023.2 | ProjectWise 2023
Mark Shamoun said:The thought is it would be another Item Type property which is an adjusted value of one extracted from an element
You mean the same element or another element? If another element, you need a relationship to find it.
Keeping it simple, just the same element.
Mark Shamoun said:define a Point using expressions to populate its coordinates
Try without the dot prefix?
X = this.Centroid.X
no luck unfortunately
Hi Mark,
for what element you want to define the expression? Can you share an example?
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
What i'm essentially trying to do is attach an Item Type to a Mesh Element and get its approx. Centroid Latitude/Longitude. To do this i need a point. I have the approx centroid coordinates, but need it to be a Point to convert to Lat/Long.
Centroid_X [number] = (this.GetElement().RangeHigh.X + this.GetElement().RangeLow.X) / 2Centroid_Y [number] = (this.GetElement().RangeHigh.Y + this.GetElement().RangeLow.Y) / 2
Centroid_Point [Point] = ???
Centroid_Latitude [number] = Coordinates.GCS.GetLatitude(this.Centroid_Point)
Centroid_Longitude [number] = Coordinates.GCS.GetLongitude(this.Centroid_Point)
Mark Shamoun said:What i'm essentially trying to do is attach an Item Type to a Mesh Element and get its approx. Centroid Latitude/Longitude
So it is another try to return to this discussion from another side? ;-)
Mark Shamoun said:I have the approx centroid coordinates, but need it to be a Point to convert to Lat/Long.
I checked what is available and unfortunately it looks like you are right: There is no way how to fill the point property with own data. I tried it, but I did not find any method in available symbol providers (including Named Expressions) how to create own Point.
It is, similarly to your questions about finding related objects and heavy using of Expressions, place, where custom symbol provider is the right way (as I found it is simpler to implement own annotation definition using code than to try to hack ORD when specific annotation is not supported).