I’m trying to make a script to know in wich sheet an element to be modified is located.
I completed my script but it is too slow. I think the problem is the node ‘Is visible in view’ (archilab).
I guess that as there are 700 views in my model, it takes a long time, 15 minutes, to collect the elements in each view. I am also using the node ‘All Element in View(s)’ from Data Shapes.
Does somebody know any other faster approach?
This node is here because I was trying to find and alternative to the ‘Element.IsVisibleInView’ which is too slow.
My first suggestion doesn’t work.
Not sure if i understand your problem correctly.
But if you want to quickly filter out only the views on sheets, you could do this:
(there is a clear list in here because for some reason my project has a null view)
Not sure if you need to actually find the sheet the view is on, but i think this should work faster for you.
In fact, I need to find in which sheet appears a certain element. So I need to find in which view(s) is the element and after that, in which sheet(s) are the view(s).
My team needs to know in which plan(sheet) a certain element appears when the client asks to modify it. This way we know which sheets are affected by this modification and which sheets need to be resubmitted.
Try my script above, it does what you want i believe.
It first finds all views that are on a sheet to begin with, then it finds what view the selected element is in, and then it finds the sheet the view is on.
Spotted a mistake in my above suggestion, this should work for you and I think its faster for you this way
Thank you for helping me!
Did you try your script in a file containing a lot of views?
Could you please sent me the dynamo please? I’m going to try it in my file with 700 views.
That node now will only check views which are placed on a sheet, this omits all your workviews and other views not placed on sheet. I assume that significantly reduces the list of views it has to search through.
I haven’t tried it in a large file myself, please let me know if this is faster.
viewsheets.dyn (21.8 KB)
I tested your script but I have the same probleme, unfortunately. It took 15 minutes. I have 761 views.
Could you explain what the end goal here is? What will you do with the sheets the element is visible in?
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.
@JC.Moreno, can you share rvt and dyn files? Have some idea to check.
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)
Thank you for helping. I used your script but it also takes a long time to run.
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.