# Script 2nd run altering results of the 1st run

**URL:** <https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668>\
**Category:** Revit\
**Created:** [January 14, 2019, 3:16pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668 "2019-01-14T15:16:43Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 16, 2019, 5:13pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/21 "2019-01-16T17:13:30Z")

</div>

Try upgrading to the latest Dynamo build 2.0.2 and see if that fixes it.

---

<div class="post-metadata">

**Author:** ![lucaspfmoreira](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@lucaspfmoreira](https://forum.dynamobim.com/u/lucaspfmoreira)\
**Post date:** [January 16, 2019, 5:19pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/22 "2019-01-16T17:19:23Z")

</div>

Roger that!

---

<div class="post-metadata">

**Author:** ![lucaspfmoreira](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@lucaspfmoreira](https://forum.dynamobim.com/u/lucaspfmoreira)\
**Post date:** [January 16, 2019, 5:58pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/23 "2019-01-16T17:58:14Z")

</div>

It solved the speed error! thanks for that. I am getting a new error now.

Warning: Sheet.ByNameNumberTitleBlockAndViews operation failed.  
View 0 could not be packed on the Sheet. The sheet is 1.41666666666666 x 0.91666666666667 and the view to be added is 0.407291666666668 x 0.983473154687024.

Did you experienced that?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 16, 2019, 6:58pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/24 "2019-01-16T18:58:56Z")

</div>

Nope - maybe the view offset related?

---

<div class="post-metadata">

**Author:** ![lucaspfmoreira](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@lucaspfmoreira](https://forum.dynamobim.com/u/lucaspfmoreira)\
**Post date:** [January 16, 2019, 7:31pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/25 "2019-01-16T19:31:13Z")

</div>

No I think the problem is my python node. Is not feeding the vectors in the correct order as the views are requesting it. Mind sharing yours?

mine is:

```
import clr 
clr.AddReference('ProtoGeometry') 
from Autodesk.DesignScript.Geometry import *  
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import DocumentManager and TransactionManager 
clr.AddReference("RevitServices") 
import RevitServices from RevitServices.Persistence 
import DocumentManager from RevitServices.Transactions 
import TransactionManager from System.Collections.Generic import *  
# Import RevitAPI clr.AddReference("RevitAPI") 
import Autodesk  

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

#The inputs to this node will be stored as a list in the IN variable. 
pcE = IN[0] 
PCtransforms = [] 
PClocations = [] 
r=[] 

if isinstance(pcE,(list,)): 
  for i in pcE: 
    e = UnwrapElement(i) 
    tbX = e.GetTotalTransform().BasisX 
    vecX = Vector.ByCoordinates(tbX.X, tbX.Y, tbX.Z) 
    tbY = e.GetTotalTransform().BasisY 
    vecY = Vector.ByCoordinates(tbY.X, tbY.Y, tbY.Z) 
    tbZ = e.GetTotalTransform().BasisZ 
    vecZ = Vector.ByCoordinates(tbZ.X, tbZ.Y, tbZ.Z) 
    r.append([vecX, vecY, vecZ]) 
else:
  e = UnwrapElement(pcE) 
  tbX = e.GetTotalTransform().BasisX 
  vecX = Vector.ByCoordinates(tbX.X, tbX.Y, tbX.Z)
  tbY = e.GetTotalTransform().BasisY 
  vecY = Vector.ByCoordinates(tbY.X, tbY.Y, tbY.Z) 
  tbZ = e.GetTotalTransform().BasisZ 
  vecZ = Vector.ByCoordinates(tbZ.X, tbZ.Y, tbZ.Z) 
  r.append([vecX, vecY, vecZ]) 

#Assign your output to the OUT variable 

OUT = r

```

Them I grab each list of vectors with:

```
a@L2<0>;
a@L2<1>;
a@L2<1>;

```

respectively on DS code nodes. Where a is the list from the python node.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [January 16, 2019, 7:38pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/26 "2019-01-16T19:38:02Z")

</div>

there is an alternative

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/6/a6615f3529f8f968a9d065d2168bbb9d0833f63b.png)

---

<div class="post-metadata">

**Author:** ![lucaspfmoreira](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@lucaspfmoreira](https://forum.dynamobim.com/u/lucaspfmoreira)\
**Post date:** [January 16, 2019, 7:39pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/27 "2019-01-16T19:39:05Z")

</div>

Hi Marcel, I was just thinking of that! Thanks for the tip! I will be sure to give it a try!

---

<div class="post-metadata">

**Author:** ![fathygad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/fathygad/32/42613_2.png) [@fathygad](https://forum.dynamobim.com/u/fathygad)\
**Post date:** [January 17, 2019, 7:24am UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/28 "2019-01-17T07:24:20Z")

</div>

hi @lucaspfmoreira

try this node:

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/c/5cb647330e36b07e835f43b56c43a3fe85f2d953.png)

---

<div class="post-metadata">

**Author:** ![lucaspfmoreira](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@lucaspfmoreira](https://forum.dynamobim.com/u/lucaspfmoreira)\
**Post date:** [January 17, 2019, 2:21pm UTC](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668/29 "2019-01-17T14:21:05Z")

</div>

Hi, I will! Thanks, I appreciate the help!

[Previous page](https://forum.dynamobim.com/t/script-2nd-run-altering-results-of-the-1st-run/30668.md?page=1)
