Revit 2020 API: ViewName Property Missing

Revit 2020 API: ViewName Property Missing

Anonymous
Not applicable
1,562 Views
5 Replies
Message 1 of 6

Revit 2020 API: ViewName Property Missing

Anonymous
Not applicable

On the Revit Documentation is noted that on Revit 2020 the ViewName Property is no longer available as it was for the preview versions of Revit. I cannot find an explanation for that. Any idea how to solve that?

 

http://www.revitapidocs.com/2020/d13cf4c1-1f5f-e7af-8aed-91197ee24b92.htm

0 Likes
1,563 Views
5 Replies
Replies (5)
Message 2 of 6

ahmadizm
Participant
Participant

I think you can just use the Name property (inherited from Element).

0 Likes
Message 3 of 6

jeremytammik
Autodesk
Autodesk

Dear Luis,

 

Thank you for your query, and many thanks to @ahmadizm for his helpful suggestion, with which I fully agree.

 

Unfortunately, the removal of this property was not mentioned in What's New in the Revit 2020 API:

 

https://thebuildingcoder.typepad.com/blog/2019/04/whats-new-in-the-revit-2020-api.html

 

Sorry about that.

 

What a handy link and nice multi-version comparison functionality provided by RevitApiDocs! Goes to show that automatically generated documentation sometimes has significant advantages.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 4 of 6

Archigrafix_Norge
Advocate
Advocate
[ObsoleteAttribute("This property is deprecated in Revit 2019 and will be removed in the next version of Revit. We suggest you use 'Element.Name' property instead")]


Luis Santos

archi systems as

Message 5 of 6

techXMKH9
Contributor
Contributor

Just in case anybody is stuck  with Autodesk.Revit.Exceptions.ArgumentException:
// Thrown when the element requires a unique name and a non-unique name is set.

 

View name should not contain curly bracket i.e "{}".

 

0 Likes
Message 6 of 6

joshua.lumley
Advocate
Advocate

Here is the solution: search for all instance of ".ViewName" and replace with ".Name". 
Problem solved.

0 Likes