- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,i i have no idea when i want to transform three-dimensional coordinates into two-dimensional coordinates,thie following is my code:
Reference refFace = uidoc.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Face, "Please select a face!");
CurveArrArray cutProfiles = new CurveArrArray();
CurveArray cutCurves = new CurveArray();
Element elem = doc.GetElement(refFace);
GeometryObject selectedGeoObject = elem.GetGeometryObjectFromReference(refFace);
selectedFace = selectedGeoObject as Face;
EdgeArrayArray edgeArrays = selectedFace.EdgeLoops;
foreach (EdgeArray edges in edgeArrays)
{
foreach (Edge e in edges)
{
cutCurves.Append(e.AsCurve());
}
}
cutProfiles.Append(cutCurves);
CurveArray path= new CurveArray();
Line line =Line.CreateBound(new XYZ(0,0,0),new XYZ(10,10,10));
SweepProfile Sprofile = application.Create.NewCurveLoopsProfile(cutProfiles);
Sweep sweep = doc.FamilyCreate.NewSweep(false, path, sketchPlane, Sprofile, 0, ProfilePlaneLocation.Start);
it is failed,i find the curve in cutProfiles is three-dimensional and the profile in sweep need two-dimensional, i need your help,thankyou.
Solved! Go to Solution.