current position:Home>Revit secondary development stretching problem

Revit secondary development stretching problem

2022-06-24 09:24:21CSDN Q & A

revit When secondary development establishes stretching , I used to order everything y Values are 0, Creating a cube is normal ; I will now put the first point Y Value changed to -100,revit It's a mistake “ Nonplanar curve ”; How to adjust it . The code is as follows

            Line line1 = Line.CreateBound(new XYZ(-1500, 0, -100), new XYZ(1500, 0,0));            Line line2 = Line.CreateBound(new XYZ(1500, 0, 0), new XYZ(1500, 20108, 0));            Line line3 = Line.CreateBound(new XYZ(1500, 20108, 0), new XYZ(-1500, 20108, 0));            Line line4 = Line.CreateBound(new XYZ(-1500, 20108, 0), new XYZ(-1500, 0, -100));            CurveLoop loop = new CurveLoop();            loop.Append(line1);            loop.Append(line2);            loop.Append(line3);            loop.Append(line4);            List<CurveLoop> loops = new List<CurveLoop>() { loop };            XYZ direction = new XYZ(0, 0, 1);// Stretching direction             Solid solid = GeometryCreationUtilities.CreateExtrusionGeometry(loops, direction, 300);            DirectShape shape = DirectShape.CreateElement(doc, new ElementId(BuiltInCategory.OST_StructuralFoundation));            shape.AppendShape(new List<GeometryObject>() { solid });

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/175/202206171631276821.html

Random recommended