Instance does not have a single calculation point

image

I’m not sure if there is something going on with the families or with the python script. This script and python node as worked in the past. I’m not sure if there is a way to find the family instance that could be containing these multiple calculation points.

I’m also realizing now, that this might meant he family instance has no calculation point. The warning is kind of vague but I think the no calculation point interpretation makes more sense.

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from Autodesk.Revit.DB import SpatialElementCalculationPoint
from RevitServices.Persistence import DocumentManager
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

doc = DocumentManager.Instance.CurrentDBDocument
# The inputs to this node will be stored as a list in the IN variables.
element = UnwrapElement(IN[0])
# Place your code below this line
pointList = []
pointCon = []

if not isinstance(element, list):
    element = [element]

#for i in element:
#    pointList.append(1)

for i in range(len(element)):
    pointList.append(element[i].GetSpatialElementCalculationPoint())

for i in range(len(pointList)):
    pointCon.append(pointList[i].ToPoint())
#xCoord = roomCalcPoint.__class_getitem__.X
#roomCalcPoint = element
# Assign your output to the OUT variable.
OUT = pointCon


Was able to use an orchid to find families that return null.

@crapai ,

i can just use IronPython2

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

elements = UnwrapElement(IN[0])

pointCon = []
points = []

for e in elements:
    pointCon.append(e.GetSpatialElementCalculationPoint())  # Corrected method name from HasSpatialElementCalculationPoint() to GetSpatialElementCalculationPoint()

for point in pointCon:
    if point is not None:
        p = XYZ(point.X, point.Y, point.Z)
        points.append(p.ToPoint())

# Assign your output to the OUT variable.
OUT = points

Issue is you get XYZ Values you have to feed points …
grafik

KR

Andreas

1 Like

Are one of your families doors or windows? If so you’d have to use the ToRoom/FromRoom calculation points.

Thanks for the response but no. There were simply two new families that didn’t have the room calculation point turned on. I was able to select them using the watch node, open the file and update it.

@crapai ,

finaly i am able to filter these elements:

elements = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_GenericModel).WhereElementIsNotElementType().ToElements()

calpoints = [i.HasSpatialElementCalculationPoint for i in elements]

OUT = calpoints
1 Like

Is there any way to activate the room calculation point of project Revit families with Dynamo without open each family and toogle on the option and save and overwrite in the project?

If you mean not opening it at all, no I don’t think so. But using Dynamo, I’m sure you could open in the background, toggle the setting, save, load, and close the files. I may be misremembering but last time I checked I couldn’t find a node to toggle room calculation but I think you can write a python node for it.