How to get contour lines from toposolid?

looks like RevitLookup tool can get contour lines …
how to get contour lines from toposolid - Autodesk Community - Revit Products

edit: need to add options.View = doc.ActiveView;

1 Like

Hi,
you can use GetDependentElements() method

import clr
import sys
import System

#
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

#Preparing input from dynamo to revit
topoSolid = UnwrapElement(IN[0])

c_filter = ElementClassFilter(clr.GetClrType(DB.CurveElement))
lines = [doc.GetElement(xId) for xId in topoSolid.GetDependentElements(c_filter)]

OUT = [c.GeometryCurve.ToProtoType() for c in lines]

EDIT : error of understanding, this method does not allow getting isolines

1 Like

thanks c.poupin, are you sure all contour lines listed? should be more (primary and secondary), not just boundary

Edit :
ok I was fooled by a French translation/interpretation error, (contour lines => isolines)
so actually my method is actually not the right one

seems you still have to get it from GeometryElement

1 Like