Rotate Inclined Face based element

I want to rotate this inclined element with red axis. Which nodes can do this?

1 Like

@vishalghuge2500 ,

try this:


or only existing instances

KR
Andreas

1 Like

@Draxl_Andreas
I’m placing number of poles on sloped road. so I’m placing this poles by faces & points.
so placed poles are inclined. so if I rotate them with familyinstance.SetRoation node, they will not rotate properly.


i think this node is rotating pole with blue axis but i want with red, as shown in below snap

@vishalghuge2500 ,

it that case, your family has to be modeled right! Some kind of reference line where a family is nested…

KR

Andreas

hello, try with this script can be element and bearing face selection (rotation around family axis)


Forum english 25 juillet 2023.dyn (16.6 KB)

import clr
import System
import math

from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager 

clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")

import Autodesk 
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication 
app = uiapp.Application 
uidoc = uiapp.ActiveUIDocument

elmt=UnwrapElement(IN[0])
pt_loc=elmt.Location
ang_radian=IN[1]*math.pi/180
line_dyna=IN[2][0]
line_axis=line_dyna.ToRevitType()

TransactionManager.Instance.EnsureInTransaction(doc)
rot=pt_loc.Rotate(line_axis,ang_radian)
TransactionManager.Instance.TransactionTaskDone()

OUT = elmt,rot
edit: Picture before after

image

cordially
christian.stan

@christian.stan
PERFECT, Thanks

1 Like