NameError on Floorplan by Room

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. :slight_smile:

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.

3 Likes

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.

1 Like

Hi, I’ve got the same problem. Using Dynamo 2.0.2.
problem looks like this:
Problem
and when I look at the python in FloorPlan.ByRoom node in line 99 it already has wriitten “newView”:
Python1
@martin.scholl
Can You please help me?

thx
Piotr

…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.

Capital V

3 Likes

@martin.scholl again in this thread with the sharp eye. :+1:

aah. thx @martin.scholl ):grinning: my bad

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

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
I cannot test this since I do not have access to 2020.

1 Like

Thank you, that works with ‘Name’

1 Like

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!

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.