triangulated mullion vertices not correct
Not applicable
02-20-2017
04:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
After the triangulation of the mullions in my project, it seems that the vertices Z isn't right. It gives me an value to high ( like 60 meters to high ) or to low ( like 150 meters below 0 ). I am using this code to get the vertices, can someone help me getting the right values? Walls and floors are going correctly by the code, but mullions aren't.
triangle.get_Vertex(x) gives us an very odd Z value.
if(wall.Walltype.Kind == WallKind.Curtain) { // Loop mullions foreach (ElementId mullionId in this.curtainWall.CurtainGrid.GetMullionIds()) { // Get mullion Element mullion = document.GetElement(mullionId); // Get element geometry Options options = new Options(); GeometryElement geometryElement = element.get_Geometry(options); // Loop geometry objects foreach (GeometryObject geometryObject in geometryElement) { // Cast as solid Solid solid = geometryObject as Solid; // Loops solids foreach (Solid solid in solids) { // Loop faces foreach (Face geomFace in solid.Faces) { if(geomFace.Triangulate().Vertices.Count < 3) { continue; } Mesh mesh = geomFace.Triangulate(); for (int t = 0; t < mesh.NumTriangles; t++) { //Create new face PartFace face = new PartFace(); MeshTriangle triangle = mesh.get_Triangle(t); // Add coordinate to face face.Coordinates.Add(triangle.get_Vertex(0) / feet); face.Coordinates.Add(triangle.get_Vertex(1) / feet); face.Coordinates.Add(triangle.get_Vertex(2) / feet); // Add face to list polygon.Faces.Add(face); } } } } } }
With kind regards,
Guus
Link copied