Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Find And Select Entities Without Tags Error #2202

Closed
5 tasks done
JerryWu25 opened this issue Apr 12, 2024 · 2 comments
Closed
5 tasks done

[Bug]: Find And Select Entities Without Tags Error #2202

JerryWu25 opened this issue Apr 12, 2024 · 2 comments
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]

Comments

@JerryWu25
Copy link

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

Used the Find And Select Entities Without Tags for walls in a plan view, got the error as below

⌨ Error/Debug Message

IronPython Traceback:
Traceback (most recent call last):
 File "C:\PyRevit-Master\PyRevit\extensions\pyRevitTools.extension\pyRevit.tab\Selection.panel\select.stack\Select.pulldown\Find And Select Entities Without Tags.pushbutton\script.py", line 243, in <module>
ValueError: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Script Executor Traceback:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
 at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
 at System.Collections.Generic.List`1.get_Item(Int32 index)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
 at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)

♻️ To Reproduce

No response

⏲️ Expected behavior

No response

🖥️ Hardware and Software Setup (please complete the following information)

==> Extension Search Paths
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2024 | Version: 24.1.11.26 | Build: 20230911_1230(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
Autodesk Revit 2023 | Version: 23.0.11.19 | Build: 20220503_1030(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2023\"
2022.1.5 | Version: 22.1.50.17 | Build: 20230915_1530(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
==> Running Revit Instances
PID: 41152 | 2022.1.5 | Version: 22.1.50.17 | Build: 20230915_1530(x64) | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2022"
==> User Environment
Microsoft Windows 10 [Version 10.0.19045]
Executing User: xxx
Active User: xxx
Admin Access: No
%APPDATA%: "C:\Users\xxx\AppData\Roaming"
Latest Installed .Net Framework: 4.8
No .Net Target Packs are installed.
No .Ne-Core Target Packs are installed.
pyRevit CLI v4.8.15.24089+0912.f079f5fd51756b988a06d005d4f4cd2961f36e63

Additional context

No response

@JerryWu25 JerryWu25 added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Apr 12, 2024
@sanzoghenzo
Copy link
Contributor

Hi @JerryWu25,
I'm sorry you're having troubles with that command.
I cannot test it right now, but in the meantime you could try to detect which element gives you troubles by adding the following before the line 243 of the script (ALT+click on the button to open the script folder)

print("Element", eltid, "Tagged local element Ids", elt.GetTaggedLocalElementIds())

In the output windows you should see a list of Element ......, the last one (but it might as well be the first) before the error is the one that gives you trouble.

If the end of the line is gibberish, try to use list(elt.GetTaggedLocalElementIds()) instead to make it a python list that should be printed more nicely.

Once you have the incriminating element Id, it will be easier to troubleshoot and reproduce the issue

@JerryWu25
Copy link
Author

Hi @sanzoghenzo , thanks for the hint, for some reason that "troublemaker" somehow disappeared this morning, we might accidentally fixed it, I will definitely try your tips if I see it again and I will reopen another case.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]
Projects
None yet
Development

No branches or pull requests

2 participants