Found a bug with Design Script and Revit Views.
Wanted to ask first is it only for me or anyone else.
If you pass an ElementType to the .ElementsOfCategoryInDocument function it deletes all the views in Revit (Except one ofc).
Also to note, first I got the Views By Category and than I just changed Revit.Category.ByName(“Views”) -->Revit.ElementType.ByName(“Views”) and then it deletes them.
I discovered this while playing around in Design Script trying both of the collector functions to answer this question.
What do your warnings say? “Views” isn’t a valid ElementType and you’re only doing a collection here, so I don’t see how Dynamo would even be opening a transaction in Revit to delete anything. I don’t think you have the right document type either.
edit: the collector I only manage to have in Python in DesignScript (I have never had, even if I have already seen topics where we see it, perhaps a class coming from an uninstalled package)
That is a very strange error and is something on Dynamo’s side. I think my node just happens to be using a method in Dynamo that is freaking out when an end-user uses it incorrectly. It seems to be related to when I try to cast a category as an element type.
The Collector.OfCategoryInDocument node is meant to be used in a document other than your current one. You are literally using this incorrectly in this example. But either way it shouldn’t allow for this perhaps. I will fix that now.
Let me look at fixing the node to where it disables this kind of use.
Additionally, I will be looking at how to disable it from being allowed in design script to protect from issues like this.
No problem. But it might be worth thinking about the language when referencing someone’s work.
Sorry for my tone here, but the way this came off initially (on the comment I was tagged on), I am honestly thinking about removing that node altogether and being rid of this issue immediately.
Definitely my fault for wording it wrong, didn’t think it would be interpreted in a negative way.
Hopefully my comment didn’t discourage you completely from trying to resolve this anomaly, because as we seen demonstrated in the past, we all learn a lot from your input on custom node debugging.