How do you rotate around a specified center of rotation?

#1

Hi everyone,

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.

-Thanks

0 Likes

#2

It looks like setting the center of rotation isn’t accessible in the API :confused:.
Does any one have any other ideas?

0 Likes

#3

Hi @L.Cunningham

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
3 Likes

#4

Thanks @Kulkul that worked out great.

EDIT: For those of you who may want the full graph, here it is, the Python script is obviously the one from the previous reply with no changes made :slight_smile:

-Thanks

0 Likes