project Curves to a view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'am trying to project curves retrieves from the edges of a roof to the plan view above the roof. To do So I would like to use the ConvertModelToDetailCurves, however I havn't found any code snippet using that method in python.
Here is my code :
"""MAIN PROCESS"""
debug = []
roofs_collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Roofs).WhereElementIsNotElementType()
views = FilteredElementCollector(doc).OfClass(View).WhereElementIsNotElementType()
for roof in roofs_collector:
geometry_elements = roof.get_Geometry(Options())
source_level = roof.LevelId
next_level = get_level_above(source_level)
next_level_view = get_view_from_level(doc,next_level)
debug.append(next_level_view)
for geometry_element in geometry_elements:
for face in geometry_element.Faces:
face_normal = face.ComputeNormal(UV(0.5, 0.5))
if face_normal.Z > 0.5:
edgeLoops = face.GetEdgesAsCurveLoops()
for curveLoop in edgeLoops:
curve_array = CurveArray()
for curve in curveLoop:
curve_array.Append(curve)
doc.ConvertModelToDetailCurves(next_level_view, curve_array)
However the last line is certainly wrong since I got the error message : Avertissement:TypeError : No method matches given arguments for ConvertModelToDetailCurves: (<class 'Autodesk.Revit.DB.ViewPlan'>, <class 'Autodesk.Revit.DB.CurveArray'>) [' File "<string>", line 95, in <module>\n']
Does someone has any idea on how to call the ConvertModelToDetailCurves method in python ?