ViewSet() order

ViewSet() order

Joris.vd.Meulen
Collaborator Collaborator
800 Views
3 Replies
Message 1 of 4

ViewSet() order

Joris.vd.Meulen
Collaborator
Collaborator

Guys,

 

To my understanding there is no way we can change the order of items in a ViewSet().

So if I would add a list of views "d", "b", "c" to ViewSet() using Insert and afterwards print the ViewSet the order of printing will be "b", "c", "d".

 

A bit wysiwyg looking at the traditional Print Range of Revit (select)

Right?

 

 

love python coding
0 Likes
Accepted solutions (1)
801 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

Dear Joris,

 

Thank you for your query.

 

The ViewSet class is a set that contains views.

 

A set is unordered by definition:

 

https://en.wikipedia.org/wiki/Set_(abstract_data_type)

 

If you wish to specify an order, you cannot use a set.

 

You have to use some other data type such as a list.

 

I hope this helps.

 

Best regards,

 

Jeremy

 



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

Message 3 of 4

Joris.vd.Meulen
Collaborator
Collaborator

Thanks Jeremy for your reply,

 

and yeah I noticed and figured I couldn't alter the order. However I think that the order isn't that 'unordered' as you suggest but is rather -by Revit default- naturally ordered. 

So the order as shown in the print dialog > print range in Revit is the viewset()'s default order no matter how you insert() the views in the viewset().

 

Just a check check double check and making sure I understand it (I slowly start getting the hang of revitapi).

 

 

love python coding
0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Joris,

 

Thank you for your update and understanding.

 

Congratulations on starting to grok the Revit API.

 

Unfortunately, there are some bits and pieces that are hard to understand, partly because they simply don't make sense.

 

Historical reasons, etc.

 

Almost everything important is achievable, though, one way or another.

 

Best regards,

 

Jeremy

 



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

0 Likes