Message 1 of 3

Not applicable
10-24-2018
06:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I want to create new group of lines (3d). My code looks like:
List<ElementId> setOfLines = new List<ElementId>();
for (var i = 0; i < Points.Length - 1; i++) { Line line = Line.CreateBound(Points[i], Points[i + 1]); XYZ normal = line.Direction.Normalize(); Plane plane = Plane.CreateByNormalAndOrigin(normal, Points[i]); SketchPlane sketchPlane = SketchPlane.Create(CurrentRevitDocument, plane); ModelCurve modelCurve = CurrentRevitDocument.Create.NewModelCurve(line, sketchPlane); setOfLines.Add(modelCurve. Id); } CurrentRevitDocument.Create.NewGroup(setOfLines);
But i have an exception "curve must be in the plane, pCurveCopy".
I think this is because of the coordinates of the normal, they are wrong. How can i create my 3D modelCurves right? Should I use another methods for this?
Thanks for your help.
Solved! Go to Solution.