Get rotate method by FamilyInstance

python

#1

Hi, friends!!!
I am starting learn Python and I need help. I want get FamilyInstance by rotation method (true or false). What am I doing wrong?




#2

can you write your code ?
and what is the error you got ?


#3

import clr
clr.AddReference(‘RevitAPI’)
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

from System.Collections.Generic import *

import System
clr.AddReference(‘System.Core’)
clr.ImportExtensions(System.Linq)

import math

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

point = UnwrapElement(IN[0])
rotation = []

for i in point:
rotation.append(FamilyInstance.rotate(True))

OUT = rotation


#4

try this

rotation.append(i.rotate())


#5

Thank you so much!
All working!!


#6

that’s Great :slight_smile: ,
please mark it as Solved