Create start point/end point for each model line inside mass family

Hi, i created a family mass composed by model lines, i want to place a structural framing beam for each line i’ve in the family. i wrote a code to place a point at the beginning and end of each line, but i get an empty list as result. Do you have some suggestion?

import sys
import clr
from Autodesk.DesignScript.Geometry import *

from Autodesk.Revit.DB import *

from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

points = []

mass_instances_collector = FilteredElementCollector(doc).OfClass(FamilyInstance).WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_Mass)

for mass_instance in mass_instances_collector:
    family = mass_instance.Symbol.Family
    if family.FamilyCategory.Id == BuiltInCategory.OST_Mass:
        mass_geometry = mass_instance.Symbol.get_Geometry(Options())
        for geo_obj in mass_geometry:
            if isinstance(geo_obj, GeometryInstance):
                geometry = geo_obj.GetInstanceGeometry()
                for g in geometry:
                    if isinstance(g, Line):
                        line = g
                        start_point = line.GetEndPoint(0)
                        end_point = line.GetEndPoint(1)
                        points.append((start_point.X, start_point.Y, start_point.Z))
                        points.append((end_point.X, end_point.Y, end_point.Z))

OUT = points

mass families

Your code seems like it is from a dynamo node, amirite? In this form I don’t think it would work in pyrevit. Looking at your code it should work, at least in theory (in dynamo), without actually checking it, but if you could share the family would help a lot.