I’m sorry but I don’t understand your question @MVE1112 . This node is in your script too.
I am afraid there’s not a faster way to do this as far as I know.
You need Dynamo to iterate over all your views and check every single element in the view to match it to the selected element. This takes time, especially with 700 views…
Someone more experienced might have a better suggestion but i dont think you can improve this speed that much…
Ok @MVE1112. I know that sometimes there are methods in the API faster than others. However, as you said, maybe someone else has the answer.
Thank you for helping.
Hello @Vladimir,
I’m not allowed to share the rvt file but only the dyn. Is it a problem to find out the solution?
Please find in attached the dyn file.
element_in_sheets_v1.dyn (51.9 KB)
try python from:
Hi JC,
Have you looked at what is taking the most time in your script with the Tuneup package?
I think it’s save to say what is causing the slow runtime here but it’s always good to check It times the runtime of all nodes in your script
Also, archilab has a node “Element. FindAllViewsWhereElementIsVisible” and his own variant of the node you are using.
I am not too sure which package that is from.
Hi,
No I didn’t know it. I’m gonna try it.
I am also trying the script in another files to see if this is related to the file but it does not seem to be the case.
Hi Vladimir,
It seems that the time has been shortened by half. I assume this is because it is only looking at the specific view types. However, these are the view types we use.
I imagine these nodes search all types of categories. I would really only need it to look for modelling categories and not annotation categories.
One thing I have noticed is that the execution speed changes completely when I do the following :
I choose an element in a view
I run the script (it takes 6 minutes)
I select another element in the same view
I run the script (0.1 seconds)
I select another element in another view
The script takes 6 minutes again
Hi,
I have 200.
Thank you. I’m gonna try.
Hi @Vladimir,
I made a test with your approach. The “AllElementsInView” node are still too slow. It takes about 8 minutes.
I saw that this node is using the “FilteredElementCollector” class and the “ToElements” method.
If I’m not wrong this filter is iterating every element either 2d or 3d. Maybe there are methods iterating only 3d elements. I’m not familliar with this aspects.