public static Autodesk.Revit.DB.Line ToRevit(Line source) { var start = PointInterop.ToRevit(source.StartPoint); var end = PointInterop.ToRevit(source.EndPoint); return(Autodesk.Revit.DB.Line.CreateBound(start, end)); }
public static Line FromRhino(Rhino.Geometry.LineCurve rhinoLine) { if (rhinoLine == null) { throw new ArgumentNullException(); } var line = new Line { StartPoint = PointInterop.FromRhino(rhinoLine.PointAtStart), EndPoint = PointInterop.FromRhino(rhinoLine.PointAtEnd) }; return(line); }
public static Line FromRevit(Autodesk.Revit.DB.Line revitLine) { if (revitLine == null) { throw new ArgumentNullException(); } var line = new Line { StartPoint = PointInterop.FromRevit(revitLine.GetEndPoint(0)), EndPoint = PointInterop.FromRevit(revitLine.GetEndPoint(1)) }; return(line); }
public static Wall FromRevit(Autodesk.Revit.DB.Wall revitWall) { var wall = new Wall(); wall.Thickness = revitWall.Width; // note : this will only work with unconnected walls // futher logic would be needed to handle the other cases wall.Height = revitWall.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.WALL_USER_HEIGHT_PARAM).AsDouble(); // get the base curve var locationCurve = revitWall.Location as Autodesk.Revit.DB.LocationCurve; wall.BaseLine = new Line() { StartPoint = PointInterop.FromRevit(locationCurve.Curve.GetEndPoint(0)), EndPoint = PointInterop.FromRevit(locationCurve.Curve.GetEndPoint(1)) }; return(wall); }
public static Rhino.Geometry.LineCurve ToRhino(Line source) { return(new Rhino.Geometry.LineCurve(PointInterop.ToRhino(source.StartPoint), PointInterop.ToRhino(source.EndPoint))); }