Hi,
Sorry for the delay, couldn't find the time to work on this topic again.
Thank you for your reply Jeremy but I couldn't find a solution to my issue in the SDK.
I would like to have access to the algorithm wich converts my list of points (from CSV) to a Curveloop when using Revit user interface but through the API.
To further expand my post, here is what I get using Revit API :

Here is what I get doing the same process by hand and what I want to get through the API :

Attached is the Dynamo graph I use to read the CSV and getting my Zmin and list of (x,y,z)
And below the commented python code :
import clr
import sys
import System
import math
from System.Collections.Generic import List
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.ForceCloseTransaction()
#Get units to make script unit agnostic
unitLen = doc.GetUnits().GetFormatOptions(SpecTypeId.Length).GetUnitTypeId()
#Getting Project Base point and its components
PtBase = BasePoint.GetProjectBasePoint(doc)
PtBaseAngle = PtBase.get_Parameter(BuiltInParameter.BASEPOINT_ANGLETON_PARAM).AsDouble()
PtBaseX = UnitUtils.ConvertFromInternalUnits(PtBase.get_Parameter(BuiltInParameter.BASEPOINT_EASTWEST_PARAM).AsDouble(), unitLen)
PtBaseY = UnitUtils.ConvertFromInternalUnits(PtBase.get_Parameter(BuiltInParameter.BASEPOINT_NORTHSOUTH_PARAM).AsDouble(), unitLen)
#Retrieving baseLevel
lvls = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Levels).WhereElementIsNotElementType().ToElements()
for l in lvls :
if l.Elevation == 0 :
Level0 = l
break
#Entries : List of XYZ points and Zmin
Pts = IN[0]
zMin = IN[1]
#List to log user outputs. Should be able to use the graph through DynamoPlayer
output = []
#Initiating .Net list
PointsTopo = List[XYZ]()
#Converting csv XYZ to .net list of points
for i in range(len(Pts)) :
pt = Pts[i]
#checks if x y z components exist
if len(pt) != 3:
output.append("Line "+str(i+2)+" ignored, empty value in csv")
else :
#Modify components to take into account sharedCoordinates, internal origin and basePoint are the same
try :
xPt = float(pt[0])
yPt = float(pt[1])
zPt = float(pt[2])-zMin
ptXYZ = XYZ(
UnitUtils.ConvertToInternalUnits(xPt-PtBaseX,unitLen),
UnitUtils.ConvertToInternalUnits(yPt-PtBaseY,unitLen),
UnitUtils.ConvertToInternalUnits(zPt,unitLen)
)
PointsTopo.Add(ptXYZ)
#In case one component can't be converted to float
except :
output.append("Line "+str(i+2)+" ignored, value is not a number")
#Starting transaction
TransactionManager.Instance.EnsureInTransaction(doc)
#If at least one API point has been created
if ptXYZ :
#Retrieving default Toposolid type, waiting for ElementTypeGroup implementation for toposild
typeTopoId = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Toposolid).WhereElementIsElementType().ToElements()[0].Id
#Creating the toposolid
newTopo = Toposolid.Create(doc ,PointsTopo, typeTopoId, Level0.Id)
#zMin is toposolid elevation, subtracted when creating points
elevTopo = newTopo.GetParameter(ForgeTypeId("autodesk.revit.parameter:toposolidHeightabovelevelParam-1.0.0"))
elevTopo.Set(UnitUtils.ConvertToInternalUnits(zMin,unitLen))
#Rotation so it matches trueNorth
locationTopo = newTopo.Location
rotAxis = Line.CreateUnbound(XYZ(0,0,0),XYZ(0,0,1))
locationTopo.Rotate(rotAxis,PtBaseAngle)
else :
output = "Unable to create Toposolid"
#Ending transaction
TransactionManager.Instance.TransactionTaskDone()
TransactionManager.Instance.ForceCloseTransaction()
#Give user feedback
if output :
OUT = output
else :
OUT = "Toposolid created without error"
Is there a method I can use to get the exact same concave Curveloop that I get through Revit buttons from my points ?
Thank you to anyone who can take the time to help me out,