Does anyone know of any nodes or methods to rotate Revit elements and change their center of rotation?
I currently am trying to do some model positioning coordination that utilizes origin to origin placement on the survey point coordinate system and I’ve got it to work with the exclusion of correctly orienting projects with modified project north values.
I simply need to rotate the whole link instance around the project position point given the known “angle from project north” value.
Additionally, I am really opposed to the idea of turning my linked models into family instances because that’s more work than just doing this process manually.
For those of you wondering, I am not using a shared coordinate system because our models have to utilize more than one survey point due to the size of our site.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from System.Collections.Generic import *
import math
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
#Preparing input from dynamo to revit
element = UnwrapElement(IN[0])
axis = IN[1].ToRevitType(True)
angle = (IN[2]*math.pi)/180
#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
ElementTransformUtils.RotateElement(doc, element.Id, axis, angle)
TransactionManager.Instance.TransactionTaskDone()
OUT = element
element = UnwrapElement(IN[0])
axis = IN[1].ToRevitType(True) if IN[1] is not None else None
angle = (IN[2] * math.pi) / 180 if IN[2] is not None else None
if element is None:
raise ValueError(“Input element is None”)
if axis is None:
raise ValueError(“Input axis is None”)
if angle is None:
raise ValueError(“Input angle is None”)