Span Direction translation and rotation

Hi all,

I am creating foundation slab using “Floor.ByOutlineTypeAndLevel”, but the span direction just appear in the middle by default. I would like to ask is there ways to rotate and translate the span direction mark using dynamo? I could not find any nodes related to the span direction symbol. Thanks!!
image

did you ever found a solution

You can set the Floors Span Direction Angle. Here is some python code to do it (Angle is measured from x-axis)…

import clr

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc =  DocumentManager.Instance.CurrentDBDocument

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

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

import math

import System
from System import *

def to_list(obj1):
	if hasattr(obj1,"__iter__"): return obj1
	else: return [obj1]
	
floors = to_list(UnwrapElement(IN[0]))
angles =to_list(IN[1])

outlist = []

TransactionManager.Instance.EnsureInTransaction(doc)
for f, a in zip(floors, angles):
	try:
		f.SpanDirectionAngle = math.radians(a)
		outlist.append("Success")
	except Exception, ex:
		outlist.append(ex.Message)
		
TransactionManager.Instance.TransactionTaskDone()

OUT = outlist

There is a very hacky unsupported way to set the location of the span line, but setting this resets the span angle to 0 and if you set the span angle it moves the span line back to the middle of the sketch. So, it seems you can’t set both angle and location (or at least I couldn’t get it working). But position of span line doesn’t actually matter, just the angle so I didn’t go to deep into this.

If any other pythonista is interested in pursuing setting both the ModelCurve and angle of the Span, you can get the ModelCurves by doing a rolled back delete on the floor to get all sketch elements (Model Curves). If you first set the floor span angle to 0 this will force the span model curve to be unconnected which, when you get the ModelCurves, you can get Span Line by testing for unconnected ModelCurves via the ModelCurve.IsAdjoinedCurveElement() method (which should be false and only one ModelCurve). Then you can set the ModelCurves Geometry via the ModelCurve.SetGeometryCurve() method. I’d be interested to see if anyone manages to find a workaround.

Cheers,
Dan