pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.31k stars 334 forks source link

[Bug]: Wipe Model Components not working (V5) #2410

Open sharkmullet opened 1 month ago

sharkmullet commented 1 month ago

✈ Pre-Flight checks

🐞 Describe the bug

wipe model components - unsheeted drafting views.pdf The "Wipe Model Components" under "Wipe" drop down, does not work. There appear to be some attribute error messages. I would like to use the "Remove All Unsheeted Views (Drafting Views only)" option. I tested a few others and they did not work as well.

⌨ Error/Debug Message

IronPython Traceback:
Traceback (most recent call last):
 File "C:\Program Files\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Project.panel\Wipe.pulldown\Wipe Model Components.pushbutton\script.py", line 69, in <module>
 File "C:\Program Files\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Project.panel\Wipe.pulldown\Wipe Model Components.pushbutton\wipeactions.py", line 676, in remove_all_unsheeted_drafting
 File "C:\Program Files\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Project.panel\Wipe.pulldown\Wipe Model Components.pushbutton\wipeactions.py", line 434, in _purge_all_views
 File "C:\Program Files\pyRevit-Master\pyrevitlib\pyrevit\compat.py", line 87, in get_value_func
AttributeError: 'Application' object has no attribute 'is_newer_than'

Script Executor Traceback:
System.MissingMemberException: 'Application' object has no attribute 'is_newer_than'
 at IronPython.Runtime.Binding.PythonGetMemberBinder.FastErrorGet`1.GetError(CallSite site, TSelfType target, CodeContext context) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Runtime\Binding\PythonGetMemberBinder.cs:line 180
 at IronPython.Compiler.Ast.DynamicGetMemberExpression.GetMemberInstruction.Run(InterpretedFrame frame) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Compiler\Ast\DynamicGetMemberExpression.cs:line 99
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs:line 91
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) in /_/Src/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs:line 55
 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs:line 750
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs:line 91
 at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) in /_/Src/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs:line 119
 at IronPython.Compiler.Ast.CallExpression.Invoke0Instruction.Run(InterpretedFrame frame) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Compiler\Ast\CallExpression.cs:line 233
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs:line 91
 at Microsoft.Scripting.Interpreter.LightLambda.Run8[T0,T1,T2,T3,T4,T5,T6,T7,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) in /_/Src/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs:line 314
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`10.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs:line 870
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs:line 91
 at Microsoft.Scripting.Interpreter.LightLambda.Run9[T0,T1,T2,T3,T4,T5,T6,T7,T8,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) in /_/Src/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs:line 359
 at Microsoft.Scripting.Interpreter.DynamicInstruction`9.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Instructions/DynamicInstructions.Generated.cs:line 302
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs:line 91
 at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) in /_/Src/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs:line 55
 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Instructions/DynamicInstructions.Generated.cs:line 152
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) in /_/Src/Microsoft.Dynamic/Interpreter/Interpreter.cs:line 91
 at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) in /_/Src/Microsoft.Dynamic/Interpreter/LightLambda.Generated.cs:line 86
 at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Compiler\PythonScriptCode.cs:line 65
 at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) in D:\a\pyRevit\pyRevit\dev\modules\pyRevitLabs.IronPython2\Src\IronPython\Compiler\RuntimeScriptCode.cs:line 85
 at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)

♻️ To Reproduce

  1. Go to pyRevit ribbon
  2. Select "Wipe" dropdown
  3. Select "Wipe Model Components"
  4. Check the box for "Remove All Unsheeted Views (Drafting Views only)
  5. Push the button "Wipe Model"

⏲️ Expected behavior

I expected a window with black text as it runs. Instead all red text runs, and the unsheeted views are not deleted.

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

==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.13.23182+2215" | Path: "C:\Users\PC\AppData\Roaming\pyRevit-Master"
==> Attachments
Unnamed-363FBF8 | Product: "Autodesk Revit 2025" | Engine: DEFAULT (2712) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
Unnamed-363FBF8 | Product: "24.2.1" | Engine: DEFAULT (2712) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
==> Installed Extensions
==> Default Extension Search Path
C:\Users\PC\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2025 | Version: 25.0.2.419 | Build: 20240307_1300(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2025\"
24.2.1 | Version: 24.2.10.64 | Build: 20240408_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
==> Running Revit Instances
Error: Access is denied.
Run with "--debug" option to see debug messages

Additional context

I tried uninstalling the 2024 versions and then uninstalling the 2025 version, and re-installing. It still did not work for me.

sanzoghenzo commented 1 month ago

Hi @sharkmullet This is something I fixed in #2384, but we didn't merge into the develop branch yet. We should release a new wip installer soon

sharkmullet commented 1 month ago

Thank you :)

sanzoghenzo commented 1 month ago

hi @sharkmullet, do you confirm that the issue is solved with the latest WIP installer? can we close this?

sharkmullet commented 1 month ago

checking now. do i need to uninstall 2024 pyrevit first? or can i have 2024 and 2025 revit with pyrevit? It would be helpful I think if the download came with install instructions Edit: Oh my gosh, it worked, it wiped the drafting details that are unsheeted. Thank you. I first tried installing with the Windows Installer Package and got the error below. So then I tried the "....admin_signed" application, clicked through the 'install in existing pyrevit master' pop up, and it worked for the issue of this thread (wiping model; you can close). I then wanted to test revit 2024 because i have projects there too, and it appears to work when i tested the wipe unsheeted drafting views. It was noted that the title bar of the pop up window indicates a WIP 5.0xxx version, but it still worked on revit 2024. Screenshot 2024-10-13 201842