Hi,
I use OpenRoads SDK .NET to extract the geometry
The code snippet is
using (DgnECInstanceCollection instances = DgnECManager.Manager.FindInstances(scope, query)) { foreach (var instance in instances) { if (instance.Element == null) continue; ElementGraphicsOutput.Process(element, processor); var dependantElements = element.GetDependants(); foreach (var dependantElement in dependantElements) { ElementGraphicsOutput.Process(dependantElement, processor); } } } public override BentleyStatus ProcessFacets(PolyfaceHeader meshData, bool filled) { var points = meshData.Point.ToList(); var pointIdx = meshData.PointIndex.ToList(); foreach (var dPoint3d in points) { Point3D point3D = new Point3D(dPoint3d.X, dPoint3d.Y, dPoint3d.Z); polyMeshInfo.Points.Add(point3D); } }
This method worked fine for the Corridors. the geometry extracted as expected. But Exporting another model where I have Road Lights, all the lights exported at the same position, while in the model they looks fine.I assume there is some transformation have to be applied to each instance to move it to the correct place. But I cannot find the corresponding method.
Please advise.
Regards,Victor.
Hi Victor,
please follow the best practices, especially specify the product version you use exactly!
Victor Chekalin said:Please advise.
It's hard to guess anything when you do not bother to provide complex snippet, so it's not clear how your complete ElementGraphicsProcessor class is implemented.
Is it only the shared method and nothing else? In such case, I guess the problem is that you do not implement AnnounceTransform method.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
Thank you. Finally, I have found the solution. I missed the method ElementGraphicsProcessor.AnnounceTransform(DTransform3d trans). It contains required information to transform each point to the correct position with the correct scaling.;