At the moment I am passing the lines out of my script that i want, how do I then turned these into GH curves? Just for references, these are curtain grids that I have turned into lines.
However what I want to know is how do I use the API to convert Autodesk.Revit.DB.Line (as seen in the image) into a grasshopper line that i can either bake out or even better, start to manipulate.
I just want to know where I can go next from the - Autodesk.Revit.DB.Line output
You can use Autodesk.Revit.DB.Line.GetEndPoint(index) Method and index is 0 for the start or 1 for end of the curve. Then use those points to create Gh Lines.
I have done this- but it seems a pretty long work around for something that you should just be able to cast out?
You could also argue that if I can get the point as you say and turn it to a gh point then I should in theory just be able to do the same for the line?
The way that Dynamo python button deals with this is to use ToProto() to make it into proto geometry (which I would compare to Gh geometry), and as far as I’m aware there isn’t something like this in RIR.
You could also argue that if I can get the point as you say and turn it to a gh point then I should in theory just be able to do the same for the line?
The difference is that the GetEndPoint Method is an actual Revit API Method. I’m pretty sure there isn’t a Revit API method that turns a line into a Gh line. If that get element geometry button doesn’t work then I don’t think it’s available at this point.