Hi Gopinath,
I added 4 lines to the code (pasted below) to set a similar pipe with a tangent of 1 (instead of 3).
1. No noticeable floating point change to the inplane coordinate. Image below.
2. Aproximate to what? I posted the spreadsheet showing the variation in shape. A change in tangent magnitude should significantly affect the shape of the spline.
3. I'm not so familiar with hermite splines either (hence the google references above). It's a curious choice given every other software seems to have opted for nurbs. I'd like to accurately and reliably create and extract geometry with Revit.
I look forward to hearing further expanation about the way Revit provides API access to this geometry.
Cheers,
Jon

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.DB.Plumbing;
namespace GGYM
{
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class ImportIFCGeomGym : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
Document document = commandData.Application.ActiveUIDocument.Document;
Transaction trn = new Transaction(document, "ggTest");
trn.Start();
FilteredElementCollector collector = new FilteredElementCollector(document).OfClass(typeof(FlexPipeType));
ElementId pipeTypeId = collector.FirstElementId();
// find a pipe system type
FilteredElementCollector sysCollector = new FilteredElementCollector(document);
sysCollector.OfClass(typeof(PipingSystemType));
ElementId pipeSysTypeId = sysCollector.FirstElementId();
Level l = null;
FilteredElementCollector fec = new FilteredElementCollector(document).OfClass(typeof(Level));
foreach(Level lvl in fec)
{
l = lvl;
break;
}
FlexPipe pipe = null;
if (pipeTypeId != ElementId.InvalidElementId && pipeSysTypeId != ElementId.InvalidElementId)
{
List<XYZ> points = new List<XYZ>();
points.Add(new XYZ(0, 0, 0));
points.Add(new XYZ(3, 0, 1));
pipe = FlexPipe.Create(document, pipeSysTypeId, pipeTypeId, l.Id,new XYZ(0,0,1),new XYZ(1,0,0), points);
points.Clear();
points.Add(new XYZ(0, 1, 0));
points.Add(new XYZ(3, 1, 1));
pipe = FlexPipe.Create(document, pipeSysTypeId, pipeTypeId, l.Id,new XYZ(0,0,3),new XYZ(3,0,0), points);
}
trn.Commit();
return Result.Succeeded;
}
}
}