# First attempt Editing a Python script

**URL:** <https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156>\
**Category:** Revit\
**Tags:** python\
**Created:** [February 16, 2018, 3:35pm UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156 "2018-02-16T15:35:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [February 16, 2018, 3:35pm UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/1 "2018-02-16T15:35:50Z")

</div>

Hi All,

The below Python script first get’s the AssemblyOrigin of an AssemblyInstance.  
[GetTransform](http://www.revitapidocs.com/2017.1/e369679d-a16e-ef8a-76fe-e69922540c73.htm)  
Next step is the rotation of this AssemblyOrigin.  
[CreateRotationAtPoint](http://www.revitapidocs.com/2017.1/8da64cca-bea9-4750-1f79-f6de3867191e.htm)  
This is the part that doesn’t work properly. The AssemblyOrigin is rotated, but it seems to take a **random** basepoint for this rotation. **It is my goal that it rotates around its own (z)axis**.  
I understand what the code does, but i’m not a programmer so i don’t know how to edit the (or add) code.  
I hope someone is willing to help me out.

```
import clr
import math
clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

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 *

def tolist(obj1):
	if hasattr(obj1," __iter__"): return obj1
	else: return [obj1]

elems = tolist(UnwrapElement(IN[0]))
axis = tolist(IN[1])
rot = tolist(IN[2])

outList = []

for e, a, r in zip(elems, axis, rot):
        trans = e.GetTransform()
    	transRot = trans.CreateRotationAtPoint(a.ToXyz(),math.radians(r), trans.Origin)
	try:
		TransactionManager.Instance.EnsureInTransaction(doc)
    	e.SetTransform(transRot)
		TransactionManager.Instance.TransactionTaskDone()
		outList.append(e)
	except Exception, e:
	outList.append(e.message)

OUT = outList

```

![picture%204](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/a/5a33f99a6aa4671fe6b070b1e731b25dfc00f164.png)

**Before running the Python script**

![picture%205](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/1/a106ed1c36703de5c172ce2f866092366a9074f6.png)

**After running the Python script**

![picture%206](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/7/c77fd84d43758e7b7e177819d21980916dfd9afa.png)

Any help is much appreciated.

Kind regards,  
Mark

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [February 16, 2018, 5:53pm UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/3 "2018-02-16T17:53:30Z")

</div>

HI Erik,

Maybe ik looks like it has some similarities, but this a complete new one 😀

Kind regards,  
Mark

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [February 20, 2018, 4:10am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/4 "2018-02-20T04:10:22Z")

</div>

This is just a guess but using the Vector.ZAxis is essentially a vector(0,0,1) and which works in Dynamo but when used in Revit, you convert it to a point (0,0,1) and you would be rotating using this as the center point, right? So you are rotating the element around basically the origin of the project. Instead, you want the center point of element. I’m not good enough at API to know how to get that but I think that would be where you start?

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [February 22, 2018, 9:05am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/5 "2018-02-22T09:05:27Z")

</div>

Hi @kennyb6,

I made an attempt to create an axis(line) at the Origin of the Assembly.  
I added two lines of code (bp and axis).  
In the next line of code i replaced “**a.ToXyz()**” by “ **axis** ”.

```
    for e, a, r in zip(elems, axis, rot):
	    trans = e.GetTransform()
	    bp = trans.Origin
	    axis = Line.CreateBound(bp, XYZ(bp.X, bp.Y, bp.Z+1.0))
	    transRot = trans.CreateRotationAtPoint(axis, math.radians(r), bp)
	    try:

```

This code results in the below error.

![imageedit_1_8164289079](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/3/a35f4a75b3f90916b13f0e2b82ffa83f9da8186b.jpg)

Does anyone have smart ideas ?

Thanks in advance,  
Mark

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [February 22, 2018, 9:11am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/6 "2018-02-22T09:11:26Z")

</div>

The error says it all, pretty much. You made axis a line, but it wants a point XYZ. Have you tried using bp as the axis?

Also, read this thread: [https://forums.autodesk.com/t5/revit-api-forum/cannot-figure-out-how-the-transform-createrotationatpoint-works/td-p/5663052](https://forums.autodesk.com/t5/revit-api-forum/cannot-figure-out-how-the-transform-createrotationatpoint-works/td-p/5663052)

It looks like what you should be using is [Transform.CreateRotation(XYZ _axis_, double _angle_)](http://www.revitapidocs.com/2017/01cddc01-b348-3c51-d2ad-c61ac64c6da4.htm)

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [February 22, 2018, 9:14am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/7 "2018-02-22T09:14:58Z")

</div>

To use the Transform.CreateRotationAtPoint method, it looks like you need to use axis = XYZ.BasisZ as the axis.

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [February 22, 2018, 10:11am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/8 "2018-02-22T10:11:20Z")

</div>

> [@kennyb6](#):
>
> Have you tried using bp as the axis?

Yes i did, but that gives me weird results (because it don’t know in wich direction it should rotate anymore).

> [@kennyb6](#):
>
> It looks like what you should be using is Transform.CreateRotation(XYZ axis, double angle)

That way i can’t define the basepoint anymore (i want to rotate the AssemblyOrigin around it’s own axis).

> [@kennyb6](#):
>
> it looks like you need to use axis = XYZ.BasisZ as the axis.

That would give me the result below  
 ![imageedit_1_9765055701](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/1/612a42df5524f0451cd21e9f6730745cce8edbc2.jpg)

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [March 16, 2018, 3:39pm UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/9 "2018-03-16T15:39:05Z")

</div>

I did another attempt to modify the above Python code.  
It works now the way i would like it to, but only for **one** element.  
If i feed it with a list of elements only the **last one** is modified 😥  
Can anyone tell me why the code doesn’t work for multiple elements ?

```
import clr
import math
clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

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 *

def tolist(obj1):
    if hasattr(obj1," __iter__"): return obj1
    else: return [obj1]

run = tolist(IN[0])[0]
elems = tolist(UnwrapElement(IN[1]))
Xvector = tolist(IN[2])
Yvector = tolist(IN[3])
Zvector = tolist(IN[4])

outList = []
if run:
    for e, xv, yv, zv in zip(elems, Xvector, Yvector, Zvector):

	    trans = e.GetTransform()
	    trans.BasisX = xv.ToXyz()
	    trans.BasisY = yv.ToXyz()
	    trans.BasisZ = zv.ToXyz()
	    try:
		    TransactionManager.Instance.EnsureInTransaction(doc)
		    e.SetTransform(trans)
		    TransactionManager.Instance.TransactionTaskDone()
		    outList.append(e)
	    except Exception, e:
		    outList.append(e.message)
    OUT = outList
else:
    OUT = "Please set Run to True" 

```

 ![Assemblies_ModifyOrigin](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/f/6f718aed27ff18aa9c98a29419a935e890cbf494.png)

Kind regards,  
Mark

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [March 16, 2018, 4:09pm UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/10 "2018-03-16T16:09:47Z")

</div>

Coming in late to the conversation but you can see awilliams code here. It works with just one element (my scripting is not quite there to get it to a list). It seams to be the same problem you are having but figured I wouls share since they are similar.

> [@Rotate Elevation Marker](https://forum.dynamobim.com/t/rotate-elevation-marker/18941/2):
>
> I wasn’t sure how you were constructing your lines, etc. so I made a new code that constructs them within the Python script. In either case, the warning you got means it wanted an Autodesk.Revit.DB.Line and you were giving it a Dynamo Line so if you modify your axis input line to be UnwrapElement(IN[1]).ToRevitType() your code should work. Here is the code I created; I haven’t modified it to handle lists yet but thought I would share now anyhow import clr import math clr.AddReference('RevitAP…

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [March 19, 2018, 1:51am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/11 "2018-03-19T01:51:00Z")

</div>

Hard to tell what is wrong here without access to the Revit project or script. I am assuming you have the same number for all of the python inputs (8 of each input, except IN[0]). I don’t know if the unwrapping makes a difference as I always unwrap each element individually, not as a list. Try this script if it makes any difference:

```
import clr
import math
clr.AddReference("ProtoGeometry")
from Autodesk.DesignScript.Geometry import *

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 *

def tolist(obj1):
    if hasattr(obj1," __iter__"): return obj1
    else: return [obj1]

run = tolist(IN[0])[0]
elem = []
for i in IN[1]:
  elem.append(UnwrapElement[i])
elems = tolist(elem)
Xvector = tolist(IN[2])
Yvector = tolist(IN[3])
Zvector = tolist(IN[4])

outList = []
if run:
    for e, xv, yv, zv in zip(elems, Xvector, Yvector, Zvector):

	    trans = e.GetTransform()
	    trans.BasisX = xv.ToXyz()
	    trans.BasisY = yv.ToXyz()
	    trans.BasisZ = zv.ToXyz()
	    try:
		    TransactionManager.Instance.EnsureInTransaction(doc)
		    e.SetTransform(trans)
		    TransactionManager.Instance.TransactionTaskDone()
		    outList.append(e)
	    except Exception, e:
		    outList.append(e.message)
    OUT = outList
else:
    OUT = "Please set Run to True"
```

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [March 19, 2018, 9:13am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/12 "2018-03-19T09:13:49Z")

</div>

Hi Kenny,

Thanks a lot for your response.  
I tried your code, but unfortunately it gives me the below error.

 ![error](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/e/ee6f6343a3fc237802604648cc5cf3f2370748e7.jpg)

I’m a Python Newby, but my gut feeling tells me there is something missing in the **for loop** part.

> [@kennyb6](#):
>
> Hard to tell what is wrong here without access to the Revit project or script.

[Assemblies\_ModifyOrigin\_v01.dyn](https://forum.dynamobim.com/uploads/short-url/rinN9ZaTPRde8HeduPKgc58H0k4.dyn) (8.4 KB)  
[Assemblies\_ModifyOrigin\_v01.rvt](https://forum.dynamobim.com/uploads/short-url/47xia0sVpDMundVhpACTDmd1JEH.rvt) (2.3 MB)

Kind regards,  
Mark

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [March 19, 2018, 9:25am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/13 "2018-03-19T09:25:31Z")

</div>

In your file, what should I be expecting when I run the script? There are no errors but it doesn’t seem like there is any change within the Revit project.

It seems like you set their transform to itself, effectively doing nothing. Unless I am missing something here.

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [March 19, 2018, 9:42am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/14 "2018-03-19T09:42:38Z")

</div>

When you run the script only the origin of the last assembly (Generic Model 008) is modified.

 ![Last%20Assembly](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/9/e95f42adaa673de9397ef7dcbf062283ff259583.png)

It is my goal to manipulate the origin of all 8 assemblies.  
So it should itter thru all elements, and modify each origin accordingly to it’s input.

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [March 19, 2018, 10:07am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/16 "2018-03-19T10:07:17Z")

</div>

When I tried your script, it didn’t change any of their positions, not even the last one. Is it possible that the node LocalCoordinateSystem gets the vectors based off of the transform of the object? If it does, then it would explain what was happening to me, where the script was successful but didn’t change anything. Try supplying it with the bounding box center’s vectors, or using different vectors to see if they all move or not.

You could even shuffle the vectors you get from the LocalCoordinateSystem node and see if each assembly’s transform moves to another to confirm my suspicions.

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [March 19, 2018, 10:35am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/17 "2018-03-19T10:35:44Z")

</div>

to avoid misunderstanding…  
It’s my goal to rotate the origin of the assemblies, not to move them.

To manualy do this ( **or check it** ), Autodesk is telling to do it as below.  
But it would be a pain to edit all assemblies and do it manually…  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/2/225912759d86a773f0c82bc7e464850002166ab2.png)

For the rest i will follow your advise, and try different input.

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [March 19, 2018, 12:39pm UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/18 "2018-03-19T12:39:03Z")

</div>

I used a “List.GetItemAtIndex” node and run the script on **one** element at a time.  
All 8 elements gave the disired result, so there is no problem with the input of the vectors.  
The only thing i can think of is that the Python (for loop), doesn’t handle the lists correctly.

---

<div class="post-metadata">

**Author:** ![kennyb6](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kennyb6](https://forum.dynamobim.com/u/kennyb6)\
**Post date:** [March 20, 2018, 2:13am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/19 "2018-03-20T02:13:45Z")

</div>

So it isn’t because of the for loop or Python code I think.  
 ![trans2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/9/7919da6ec3c24341a625314b6c38dc945c3857fa.PNG)

 ![trans](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/a/7af88c039bec9314bd51522e357acb957031c5a5.png)

Python is saying that the element’s transform was changed to the vectors that were inputted. For reference, a list in the watch node consists of this structure:  
0 - Element  
1 - List of original transform BasisX, Y, and Z  
2 - Vectors inputted from BIM4Struc package  
3 - List of transform Basis X, Y, and Z after the python script

Honestly I am as stumped as you are. You are right that it works one at a time and I have had the problem before where if I edit many revit elements within a single dynamo script, only the last one will show the changes until I update the model, which might be what is happening here but even when checking and moving the object, it doesn’t update.

Hopefully someone with more knowledge can shed some light. Try asking @Kulkul or @Dimitar_Venkov about this.

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [March 20, 2018, 10:07am UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/20 "2018-03-20T10:07:17Z")

</div>

Hi Kenny,

Thank you very much for your time and effort to help me 👍  
You definitely pointed me in the right direction, and i think i found a solution…  
I used “ **ForceCloseTransaction** ” in stead of “ **TransactionTaskDone** ”.  
I looks like the script needs a hard break after each run.

I have to do some cleanup first, but i will post my solution for anyone who is interested.

Kind regards,  
Mark

---

<div class="post-metadata">

**Author:** ![MJB-online](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mjb-online/32/24884_2.png) [@MJB-online](https://forum.dynamobim.com/u/MJB-online)\
**Post date:** [March 21, 2018, 1:49pm UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/21 "2018-03-21T13:49:08Z")

</div>

Hi All,

For those of you who are interested, here’s my final Dynamo script.

 ![Assemblies_ModifyOrigin_v04](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/8/b84eaedba1d417f1d2a74fca6c4353036730fff6.png)  
[Assemblies\_ModifyOrigin\_v04.dyn](https://forum.dynamobim.com/uploads/short-url/w85hlWfQCD9JXbCNSAoJmewqqZr.dyn) (5.7 KB)  
I wrapped the Python script and “ **Element.LocalCoordinateSystem node** ” inside a custom node (local package).  
[Assemblies.ModifyOrigin.dyf](https://forum.dynamobim.com/uploads/short-url/xqYlCDTN8bMYuNyLLVaBLXDKN40.dyf) (26.0 KB)  
The script reads out the orientation of the (assembly) source elements, and uses that to rotate the origin of the assemblies. If you create assembly views (after running the script) these views are aligned with the element, regardless of the rotation of the element in the project. Without running the script assembly views are always aligned with the X, and Y-axis.

@Daniel_Woodcock1: Thanks a lot for providing the initial scripts.  
[https://forum.dynamobim.com/t/assembly-modify-origin/11433/7?u=mjb-online](https://forum.dynamobim.com/t/assembly-modify-origin/11433/7)  
@Dieter_Vermeulen: Thanks a lot for the “ **Element.LocalCoordinateSystem** ” node.  
@kennyb6, @Petar_Penchev1, @viktor_kuzev, and @Steven thanks a lot for your effort to help me, and pointing me in the right direction.

Kind regards,  
Mark

---

<div class="post-metadata">

**Author:** ![WadeNolanDBA](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@WadeNolanDBA](https://forum.dynamobim.com/u/WadeNolanDBA)\
**Post date:** [March 25, 2019, 10:09pm UTC](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156/22 "2019-03-25T22:09:56Z")

</div>

Hi Mark! @MJB-online

I’ve been reading through your posts, I am facing a similar task. Inside your custom node, do you know what package “element.HandOrientation” belongs to?

Thanks for your help!

[Next page](https://forum.dynamobim.com/t/first-attempt-editing-a-python-script/19156.md?page=2)
