# Creating new opening (door and windows) family types with different lengths

**URL:** <https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069>\
**Category:** Developers\
**Tags:** python, dynamo\
**Created:** [July 24, 2018, 9:10am UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069 "2018-07-24T09:10:09Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 9:10am UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/1 "2018-07-24T09:10:09Z")

</div>

Hi everyone,  
I’m facing a weird issue with dynamo scripting. I have to create many door types in the same script. The types are defined by the length of the doors that I read from an excel file so I have to create automatically doors with different lengths and may be widths. I created the script attached to this message. I already did this for the creation of walls with different widths (with walls.duplicate node) and it worked fine.  
The problem for the doors (with familytype.dupicate) is that it creates only one type and it changes its length all over the process of reading the excel file so at the end of the script execution, I obtain one family type with the last length read from excel file.

Can someone help me with this so I can create multiple types and not only one ??

Thanks,  
Akaci

 ![duplicate_family](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/c/ac01eb8eba0af6f4df4601c9626eedef32525070.PNG)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 24, 2018, 11:13am UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/2 "2018-07-24T11:13:10Z")

</div>

Hi @a.kaci,

Can you add your excel and .dyn files ?  
It’s not possible to help you with this small screenshot.

---

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 12:34pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/3 "2018-07-24T12:34:37Z")

</div>

Here they are.

[door\_personnalized\_all.dyn](https://forum.dynamobim.com/uploads/short-url/vttygLf813nuOtCAfjsx0Q87pNj.dyn) (30.6 KB)  
[id\_03\_E1\_EPSG\_3949.xlsx](https://forum.dynamobim.com/uploads/short-url/inQIx3FP7mwQKQIrHYj8XgP7sLY.xlsx) (8.5 KB)

---

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 12:41pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/4 "2018-07-24T12:41:43Z")

</div>

Sorry, the dynamo script is this one :

[door\_personnalized\_all.dyn](https://forum.dynamobim.com/uploads/short-url/lMU5zXsDlKo0Z4NRm8pQ2n8gwqD.dyn) (29.1 KB)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 24, 2018, 12:59pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/5 "2018-07-24T12:59:31Z")

</div>

You can’t input negative values into Width parameter (largeur)

---

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 1:03pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/6 "2018-07-24T13:03:51Z")

</div>

The (largeur) value is the last column in the excel file (column name : length). They are not negative.

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 24, 2018, 1:07pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/7 "2018-07-24T13:07:49Z")

</div>

Yes. but you’re not enterint the correct cells in the FamilyType.Duplicate node.  
You 've also length of 0.05 m in your excel file. Revit doesn’t make the door type.

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 24, 2018, 1:09pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/8 "2018-07-24T13:09:52Z")

</div>

I fixed your graph  
You need to review a little your excel file I think.

.[door\_personnalized\_all V2.dyn](https://forum.dynamobim.com/uploads/short-url/qPyeMPYMLpZ5QPGVChcdByB8Soe.dyn) (29.3 KB)

---

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 1:19pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/9 "2018-07-24T13:19:38Z")

</div>

No, your script didn’t work. The bug is not here.  
As you can see in the first sreenshot, all the values of the length column are read correctly. I can see in is the watch node. Then I want to create a type whose name is “the conversion of the length to string”. I want to understand why the only created type is 0,74 which corresponds to the first line in the excel file. It seems like we cannot create several types in the same script with the node (family duplicate).

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 24, 2018, 1:27pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/10 "2018-07-24T13:27:05Z")

</div>

Of course that my correction is working !

 ![Fix](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/2/52ae61e8cbf6872d7e1f8276827a541c1d152564.png)

Set lacing on longest on FamilyType.Duplicate to create several types.

Edit : Excel.ReadFromFile node doesn’t work in my company so I don’t need the transpose node.

---

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 1:29pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/11 "2018-07-24T13:29:42Z")

</div>

I will try it again 🙂

---

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 1:48pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/12 "2018-07-24T13:48:52Z")

</div>

I still get errors!!

 ![bug_doors](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/2/4219cc9e5689681975f4bc50d99b1678eea20a78.PNG)

[test\_door\_personnalized\_all V2.dyn](https://forum.dynamobim.com/uploads/short-url/6j47tV8SRtx91LeEpKkjYY1V4Gk.dyn) (13.4 KB)

---

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 1:50pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/13 "2018-07-24T13:50:51Z")

</div>

![bug_doors_up](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/0/10ccba3cf7d4d828adeb97d861266487a2cb434c.PNG)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 24, 2018, 1:55pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/14 "2018-07-24T13:55:41Z")

</div>

We are not using the same excel reader node and I think we don’t have the same first output.

Mine is from the package ExcelReader.

I edited your first try. Maybe it will work with Excel.ReadFromFile.  
[door\_personnalized\_all V3.dyn](https://forum.dynamobim.com/uploads/short-url/ic46t9OBoNlfJwFEt9mi36tBQn6.dyn) (14.0 KB)

---

<div class="post-metadata">

**Author:** ![a.kaci](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@a.kaci](https://forum.dynamobim.com/u/a.kaci)\
**Post date:** [July 24, 2018, 2:32pm UTC](https://forum.dynamobim.com/t/creating-new-opening-door-and-windows-family-types-with-different-lengths/24069/15 "2018-07-24T14:32:21Z")

</div>

Yes, this is why it wasn’t working . Now the bug is fixed.

Thanks a lot Alban!
