Create Empty Sheets Revit 2020

Does any one know how to get this :point_down:t2: to work for Revit 2020?

CreateEmptySheets.dyn (27.4 KB)

It works for Revit 2019.2, but not for Revit 2020.2.

This is what i get in Revit 2020.2.

[0] [0] Traceback (most recent call last):

  • File “”, line 56, in *
    AttributeError: ‘ViewSheet’ object has no attribute ‘ViewName’

[0] [1] Empty List

Had to change the inputs to not get warnings.

2019
Revit 2019.2
2020
Revit 2020.2

Hi @bvs1982,

The property ViewName has been removed in Revit 2020. Just replace “ViewName” by “Name” .

try:
		errorReport = None
		a=ViewSheet.Create(doc,i)
		a.Name=n
		a.SheetNumber=u
		sheets.append(a.ToDSType(False))
2 Likes

@Alban_de_Chasteigner

Thanks for you response, but that didn’t fix it for me.

NB
I hate changes like these. I am getting the hang of Dynamo and nowthey gonna
f*** me over with stuff like this :unamused:.

EDIT
Fixed. I removed the refresh from the node earlier. Shouldn’t have done that.
I put it back and now it works! Thank you again @Alban_de_Chasteigner.
Not the first time you have been my savior.

Seems to work for me (Revit 2021) :

The sheet numbers must be strings.

The custom node updated :
Tool.CreateEmptySheet.dyf (24.6 KB)

1 Like

@Alban_de_Chasteigner

Bit off-topic.
As Packages / nodes aren’t allways updated for all the different Revit versions. Is there i place i can find information about these changes so i can fix nodes
myself? i.e. ViewName to Name. So i don’t have to create a topic for stuff like this.

You have to look in the Revit API.
For example for this obsolete property :
https://apidocs.co/apps/revit/2019/d13cf4c1-1f5f-e7af-8aed-91197ee24b92.htm

Hi Alban,
I am a newbee looking at the Revit API and could use a little help, as it all looks very cryptic. I looked at your link here:

But I dont see anywhere it tells you to switch a.ViewName = n to a.Name=n I can see that ViewName was deprecated. but how did you know to fix it with a.Name?

Also, is there anywhere that explains how to read the Revit API, I have looked at it many times, but still really cant understand where to look to get information that I need to write code. I have looked at some code that I knew worked, went into the API to see if I could figure out how it looked in there and couldnt figure out the correlation. Is there some document somewhere that explains how to read the API in laymens terms?

You can read this great and educational githbook by @oliver.green :

There is also the presentation of @solamour from AU London :

3 Likes

Great! Ill take a look at those! thanks so much!!

@mix

It is in the Syntax thingy.


 We suggest you use ‘Element.Name’ property instead")]

Ahh so a.Name acts as a variable. a is = Element?