Howdy, so I tried edge references of a door to dimension. No luck as these seemed to snap to other parts of the door sometimes. Can it be done with the end point reference of the door curve/edge?
R23 Snooped a door curve (the door has nested families). I assume this means its accessible. How to get it is a bit beyond me though. What is the appropriate geometry curve to get to access? Tried Curve and edge endpointreference method. https://www.revitapidocs.com/2018/5619a3fd-38e1-fb56-7286-2e5f33a3b2b8.htm
import clr
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
# Get the current document
doc = DocumentManager.Instance.CurrentDBDocument
# Function to get endpoint references from a Curve object
def get_endpoint_references_from_curve(curve):
endpoint_references = []
try:
# Get endpoint references from the curve
start_ref = curve.GetEndPointReference(0) # Start point reference
end_ref = curve.GetEndPointReference(1) # End point reference
if start_ref is not None:
endpoint_references.append(start_ref)
if end_ref is not None:
endpoint_references.append(end_ref)
except Exception as e:
print(f"Error: {e}")
return endpoint_references
# Input: A single Curve object (e.g., from a Line geometry)
curve_input = IN[0]
# Get endpoint references for the curve
endpoint_references = get_endpoint_references_from_curve(curve_input)
OUT = endpoint_references
45_Hinge 1.rfa (1.0 MB)
Thanks for any help!