j.krol
March 8, 2019, 6:56pm
1
Hello everyone
I’ve got a problem with node Select.ByElementId.
Node shows warrnings while I induce numbers from range 300k-900k.
For example two situations:
First - 200k of ID’s range 100k-300k.
No warrnings, script is correct.
Second - same numbers of ID’s, range 300k-500k.
Warrning: Select.ByElementId operation failed
Have you any suggestions why is this happen?
Best wishes
Jadwiga
if you do the same thing with a revit file comming from the template None, what happens?
just askin
j.krol
March 8, 2019, 7:33pm
3
On default Revit template it works without warrnings (even for 1 milion IDs)
edit: think i dont want this to sound too harsh
j.krol
March 8, 2019, 7:46pm
5
It looks like it’s a problem with my template.
I open my template again, in this time with audit.
I let script again. No warrnings, but still in background shows this wierd lines.
Do you know what it means?
rebuild your template.
It may be a legacy problem, or someone that did it that no longer works at your company, abandon it i’d say, found the needle in the haystack
Not all elements can be directly selected as they may no longer be valid elements (but they are still in the database). Can you send a copy of the Revit file that causes this issue?
j.krol
March 12, 2019, 7:35am
9
I send you the file in private message.
If we find a solution it will publish here, ofc
Tomasz
March 12, 2019, 10:05am
10
Why do you need to select Revit elements in such an arbitrary way?
j.krol
March 12, 2019, 10:11am
11
I need to rename all elements in template.
And this script is like “Ctrl+A” and “Ctrl+F” - I input all elements to script, next find those which have some phrase I want to change.
If you know a better way, I’m open for suggestions
Would a filtered element collector help? You can use filters to collect elements with certain names or attributes.
Tomasz
March 12, 2019, 11:00am
13
import clr
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import FilteredElementCollector, LogicalOrFilter, ElementIsElementTypeFilter
doc = DocumentManager.Instance.CurrentDBDocument
OUT = FilteredElementCollector(doc).WherePasses(LogicalOrFilter(ElementIsElementTypeFilter(False), ElementIsElementTypeFilter(True))).ToElements()
3 Likes
j.krol
March 12, 2019, 11:45am
14
Unfortunately…
Do you know what is wrong?
Tomasz
March 12, 2019, 11:57am
15
Paste code into Python Script node instead of Python Script From String
Code blocks require script body to be put between parentheses and closed with semicolon.
1 Like
j.krol
March 12, 2019, 12:36pm
16
It worked without warrnings.
For sure, it’s more economic way than mine Thank you.
But still there are the same wierd lines.
Do you know which elements can make this?
Tomasz
March 12, 2019, 12:45pm
17
Those might leftovers from imports or other things. Please mark post as solved if your main question was answered.
j.krol
March 12, 2019, 12:56pm
18
Okay, I know what is it… It’s objects from the template under magnification so it’s nothing dangerous.
Thanks a lot for help!
1 Like