# Rotating multiple scope boxes

**URL:** <https://forum.dynamobim.com/t/rotating-multiple-scope-boxes/42861>\
**Category:** Revit\
**Created:** [November 7, 2019, 4:21am UTC](https://forum.dynamobim.com/t/rotating-multiple-scope-boxes/42861 "2019-11-07T04:21:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BIM.Mystic](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@BIM.Mystic](https://forum.dynamobim.com/u/BIM.Mystic)\
**Post date:** [November 7, 2019, 4:21am UTC](https://forum.dynamobim.com/t/rotating-multiple-scope-boxes/42861/1 "2019-11-07T04:21:19Z")

</div>

Hi There,  
I need to set up some scope boxes that rotate with varying angles. I have this data in an excel format. I thought I try to do this in dynamo. I got as far as laying out the scope boxes but got stuck with rotating it. As I could not find ways to rotate the scope boxes, I turned to try it with some python using examples found in this forum. I have encountered a problem with extracting element.Id. I have read posts in this forum but can seem to get it working.

The error message is

“Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.  
Traceback (most recent call last):  
File “”, line 45, in   
AttributeError: ‘List[object]’ object has no attribute ‘Id’”

The code is below. I am new to python and hoping someone can help to demystify what is happening

* * *

import clr

clr.AddReference(“RevitServices”)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager  
doc = DocumentManager.Instance.CurrentDBDocument  
app = DocumentManager.Instance.CurrentUIApplication.Application

clr.AddReference(“RevitNodes”)  
import Revit  
clr.ImportExtensions(Revit.Elements)  
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference(“RevitAPI”)  
from Autodesk.Revit.DB import \*

clr.AddReference(“RevitAPIUI”)  
from Autodesk.Revit.UI import \*

import System  
from System.Collections.Generic import \*

################### Definitions ###################  
def tolist(obj1):  
if hasattr(obj1,“ **iter** ”): return obj1  
else: return [obj1]  
################### Inputs ###################

scbox = IN[0]  
sbox = tolist(UnwrapElement(IN[0]))  
vec = IN[1]#.ToRevitType(True)  
lneAxis = IN[2]#.ToRevitType(True)  
angl = IN[3]

# Wrap in a Transaction

for i in sbox:  
#ElementTransformUtils.MoveElement(doc, sbox.Id, vec)  
TransactionManager.Instance.EnsureInTransaction(doc)

```
ElementTransformUtils.RotateElement(doc, sbox.Id, lneAxis, angl)

# Close Transactio
TransactionManager.Instance.TransactionTaskDone(doc)

```

* * *

---

<div class="post-metadata">

**Author:** ![jshial](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jshial/32/91559_2.png) [@jshial](https://forum.dynamobim.com/u/jshial)\
**Post date:** [November 7, 2019, 10:00am UTC](https://forum.dynamobim.com/t/rotating-multiple-scope-boxes/42861/2 "2019-11-07T10:00:42Z")

</div>

you probably mistyping “i” with “sbox”. u are iterating the sbox list, “i” represents individual box not the collection itself.

---

<div class="post-metadata">

**Author:** ![BIM.Mystic](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@BIM.Mystic](https://forum.dynamobim.com/u/BIM.Mystic)\
**Post date:** [November 8, 2019, 6:31pm UTC](https://forum.dynamobim.com/t/rotating-multiple-scope-boxes/42861/3 "2019-11-08T18:31:49Z")

</div>

Thanks for that. it worked.
