# NameError on Floorplan by Room

**URL:** <https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058>\
**Category:** Packages\
**Created:** [November 28, 2018, 9:44pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058 "2018-11-28T21:44:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![PerfectArchCo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/perfectarchco/32/28515_2.png) [@PerfectArchCo](https://forum.dynamobim.com/u/PerfectArchCo)\
**Post date:** [November 28, 2018, 9:44pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/1 "2018-11-28T21:44:53Z")

</div>

I thought I was saving the easiest for last but I am continuing to get a “NameError: ‘View’ is not defined” with the Floorplan by Room node. I tried inputting the room directly as both a list and as an element to no success but, importantly, it does generate the required floorplan in REVIT. I’ve tried restarting Dynamo before executing the code to no effect. I’m on REVIT 2017.2 and Dynamo 1.3.2 and am wondering if this isn’t due to some type of versioning issue? I suspect the view is missing inside the custom packaged node but nothing stuck out at me when I jumped into the node view. Does anyone have any ideas as to what the root cause could be? And a possible solution? Or a workaround? I have a lot of rooms to do. 🙂

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/6/16ad799646fb291ebae9afe91a1489e29efbc2cc.png)

---

<div class="post-metadata">

**Author:** ![martin.scholl](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/martin.scholl/32/54233_2.png) [@martin.scholl](https://forum.dynamobim.com/u/martin.scholl)\
**Post date:** [November 28, 2018, 10:15pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/2 "2018-11-28T22:15:20Z")

</div>

It looks like a typo in the code. line 99 is trying to set the cropbox of a variable ‘view’ that was only set inside the condition statement that is not true (line89) so there is no ‘view’ variable. Try changing ‘view’ in line 99 to newView as that is the variable created within that conditional statement.

---

<div class="post-metadata">

**Author:** ![PerfectArchCo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/perfectarchco/32/28515_2.png) [@PerfectArchCo](https://forum.dynamobim.com/u/PerfectArchCo)\
**Post date:** [November 29, 2018, 12:43am UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/3 "2018-11-29T00:43:38Z")

</div>

Good eye. Correcting the python code per @martin.scholl’s above comment did fix the error I was getting on Archilab’s FloorPlan.ByRoom node. See below.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/4/642f0493f9684059e6073b35e13e86bc53e57827.png)

---

<div class="post-metadata">

**Author:** ![Piotrek18](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@Piotrek18](https://forum.dynamobim.com/u/Piotrek18)\
**Post date:** [February 14, 2019, 9:44am UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/4 "2019-02-14T09:44:33Z")

</div>

Hi, I’ve got the same problem. Using Dynamo 2.0.2.  
problem looks like this:  
 ![Problem](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/c/9cf066e486bd5329110a55b6f082f3e1a5e29f37.jpeg)  
and when I look at the python in FloorPlan.ByRoom node in line 99 it already has wriitten “newView”:  
 ![Python1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/f/cf78574f3a5d0ddb7778b2b3330aedf8aec06d16.jpeg)  
@martin.scholl  
Can You please help me?

thx  
Piotr

---

<div class="post-metadata">

**Author:** ![Piotrek18](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@Piotrek18](https://forum.dynamobim.com/u/Piotrek18)\
**Post date:** [February 14, 2019, 9:47am UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/5 "2019-02-14T09:47:10Z")

</div>

…and what is strange - it does create the desired room plans in Revit. However in Dynamo there is no sign of it - I cannot add more nodes after to modify views, f.e. add templates etc.

---

<div class="post-metadata">

**Author:** ![martin.scholl](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/martin.scholl/32/54233_2.png) [@martin.scholl](https://forum.dynamobim.com/u/martin.scholl)\
**Post date:** [February 14, 2019, 4:09pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/6 "2019-02-14T16:09:19Z")

</div>

Capital V

---

<div class="post-metadata">

**Author:** ![PerfectArchCo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/perfectarchco/32/28515_2.png) [@PerfectArchCo](https://forum.dynamobim.com/u/PerfectArchCo)\
**Post date:** [February 14, 2019, 4:38pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/7 "2019-02-14T16:38:34Z")

</div>

@martin.scholl again in this thread with the sharp eye. 👍

---

<div class="post-metadata">

**Author:** ![Piotrek18](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@Piotrek18](https://forum.dynamobim.com/u/Piotrek18)\
**Post date:** [February 20, 2019, 3:23pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/8 "2019-02-20T15:23:24Z")

</div>

aah. thx @martin.scholl )😀 my bad

---

<div class="post-metadata">

**Author:** ![yeyosanchez](https://avatars.discourse-cdn.com/v4/letter/y/b9bd4f/32.png) [@yeyosanchez](https://forum.dynamobim.com/u/yeyosanchez)\
**Post date:** [July 31, 2019, 1:26pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/10 "2019-07-31T13:26:40Z")

</div>

in Revit 2020 + Dynamo version 2.1.0.7733, I have the same error:

File “”, line 97, in  
AttrubuteError: ‘ViewPlan’ objet has no attribute ‘ViewName’

Can you help me?  
I’ve tried the module in Revit 2019 and it works, I don’t understand why it doesn’t work in 2020

---

<div class="post-metadata">

**Author:** ![martin.scholl](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/martin.scholl/32/54233_2.png) [@martin.scholl](https://forum.dynamobim.com/u/martin.scholl)\
**Post date:** [August 1, 2019, 6:22pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/11 "2019-08-01T18:22:29Z")

</div>

I do not use Revit 2020. Looking at ViewPlan in RevitAPIdocs under 2020, there seems to be no parameter ViewName. You could try changing it to ‘Title’ or ‘Name’.  
The ViewName parameter is marked obsolete under the 2019 directory.  
A list of all the attributes can be found here.  
[https://www.revitapidocs.com/2020/37c3112a-92fe-233f-f3ac-83e8b3d5ef92.htm](https://www.revitapidocs.com/2020/37c3112a-92fe-233f-f3ac-83e8b3d5ef92.htm)  
I cannot test this since I do not have access to 2020.

---

<div class="post-metadata">

**Author:** ![yeyosanchez](https://avatars.discourse-cdn.com/v4/letter/y/b9bd4f/32.png) [@yeyosanchez](https://forum.dynamobim.com/u/yeyosanchez)\
**Post date:** [August 2, 2019, 7:45am UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/12 "2019-08-02T07:45:16Z")

</div>

Thank you, that works with ‘Name’

 ![2019-08-02_094448](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/b/bbddf65f47b0671bc6338651160b19f30c98f14f.jpeg)

---

<div class="post-metadata">

**Author:** ![Praddy](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@Praddy](https://forum.dynamobim.com/u/Praddy)\
**Post date:** [October 16, 2019, 7:29pm UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/13 "2019-10-16T19:29:09Z")

</div>

I am also on Revit 2020, and had been stuck with getting this to work for a while. Thank you @yeyosanchez for sharing the script and @martin.scholl for looking into the RevitAPIdocs!

---

<div class="post-metadata">

**Author:** ![j.wrightPYNCR](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@j.wrightPYNCR](https://forum.dynamobim.com/u/j.wrightPYNCR)\
**Post date:** [January 29, 2020, 8:49am UTC](https://forum.dynamobim.com/t/nameerror-on-floorplan-by-room/29058/14 "2020-01-29T08:49:07Z")

</div>

I had this issue this morning, you need to change the ‘newview’ to ‘newView’ with a capital ‘V’ and I can confirm this works on my script.
