How to Rotate Import Instances

Is it possible to rotate an import instance? I’ve successfully moved several of them at them at the same time with the MoveByVector node, but I need to rotate them simultaneously as well. The import instances are DWG links. I am using the archilab Rotate Family node.


Rotate DWGs.dyn (69.2 KB)

the inputs must be at same level, try to add List.Create after Element.Id node and after Angle value before you input them to the rotation node

another thing, you don’t have to convert the angle to radian

Thanks @khuzaimah.ElecEng, sorry for the late response.
I tried and tried to get that Rotate Family Node to work. I fixed the lacing and the radians issues, but still no luck. Eventually I found a different solution. It seems a bit dated, but the Elements.Rotate Node worked for this problem. The python script is below:

import clr

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
#from Autodesk.Revit.DB import ReferencePointArray
from Autodesk.Revit.DB import ElementTransformUtils
from Autodesk.Revit.DB import Line
from Autodesk.Revit.DB import Transaction
from Autodesk.Revit.DB import ElementId
from Autodesk.Revit.DB import XYZ
#from Autodesk.Revit import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)


angle = IN[1]
axisX = IN[2]
axisY = IN[3]
axisZ = IN[4]

changelist = []

# Unwrap
elem = UnwrapElement( IN[0] )

for item in IN[0]:
	nr = IN[0].index(item)

# Start Transaction
	doc = DocumentManager.Instance.CurrentDBDocument
	TransactionManager.Instance.EnsureInTransaction(doc)

# Make changes in model
#axis = NewLineBound(point (0, 0, 0), point (0, 0, 1))


	#for elem_, angle_, axisX_, axisY_, axisZ_ in zip(elem, angle, axisX, axisY, axisZ):
	axisX_ = axisX[0]
	axisY_ = axisY[0]
	axisZ_ = axisZ[0]
	elem_ = elem[nr]
	angle_ = angle[nr]
	
	axis = Line.CreateBound( XYZ(0, 0, 0), XYZ(axisX_, axisY_, axisZ_))
	changelist.append(ElementTransformUtils.RotateElement(doc, elem_.Id, axis, angle_))

# End Transaction
	TransactionManager.Instance.TransactionTaskDone()

# exit
OUT = IN[0]

I fed it with this code block:

//Rotate Elements Counter-clockwise
List.Flatten([elements],999);
List.Flatten([Math.DegreesToRadians(angles)],999);
List.Flatten([Vector.X(vector)],999);
List.Flatten([Vector.Y(vector)],999);
List.Flatten([Vector.Z(vector)],999);

It rotates everything to the correct angle, but shifts them all over the place. That’s okay though, I still knew how to send them where they needed to go! Hopefully this helps someone else out.