Hi,
I process element geometry using the ElementGraphicsProcessor class and ProcessFacets method. The method have meshData parameter which has a Point array.
The question is - what units are used there in the points array? I have 3 models and all of them have different units. First keeps the coordinate as a very large number (resolution 10000 of US Survey feet) and I use the scale factor to convert it to feet. The second has the coordinates as feet and I use at as is. And the third has a very small number as coordinates.
How to figure out what scale factor needs to use to convert any coordinates unit to feet? dgnModel.GetModelInfo() has returns the same units for all models.
Thanks.
Hi Victor,
Victor Chekalin said:The question is - what units are used there in the points array?
as Jon wrote, UORs are used in both NET and native C++ APIs for the whole MicroStation history (COM VBA the only exception).
Victor Chekalin said:How to figure out what scale factor needs to use to convert any coordinates unit to feet?
The code to obtain scale (ratio) that can be used to convert master units to UORs is:
DgnModel activeModel = Session.Instance.GetActiveDgnModel(); ModelInfo modelInfo = activeModel.GetModelInfo(); double scale = modelInfo.UorPerMaster;
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thank you both. As in my other topic, the solution is similar. I missed the method ElementGraphicsProcessor.AnnounceTransform(DTransform3d trans). It contains the required information to transform each point to the correct position with the correct scaling.
The point transformation makes the coordinates of all objects in all models to the same scaling. Then I use
double scale = modelInfo.UorPerMaster;
to get the coordinates in feet.