Hello, is it possible to select via the API the view associated with the cropbox (which has a different ID from the view)
next chart
Can we retrieve it from the view its Id without going through a selection
The rotation is working fine, I searched the View class but I think I need to search another class but I don’t know which one
Python script:
import sys
import clr
import math
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
#Inputs
Elem_view = UnwrapElement(IN[0])#View
Elem_to_rotate=UnwrapElement(IN[1])# View or BoundingBox or CropBox i don't know
Point_rotate=IN[2].ToRevitType()#Point
angle_rotate=IN[3]*math.pi/180 #Radians
#Preparation work
Line_axis=Line.CreateBound(Point_rotate,XYZ(Point_rotate.X,Point_rotate.Y,Point_rotate.Z+1))
#transaction to do the job
TransactionManager.Instance.EnsureInTransaction(doc)
transf=ElementTransformUtils.RotateElement(doc,Elem_to_rotate.Id,Line_axis,angle_rotate)
TransactionManager.Instance.TransactionTaskDone()
OUT = transf
thanks in advance
Sincerely
christian.stan