Skip to content

[Bug]: Print Function Doesn't Work #3113

@kslifter

Description

@kslifter

✈ 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

When I try to use the Print Tool I get a error popup. I have tried a handful of other tools and they all show correctly.

⌨ Error/Debug Message

IronPython Traceback:
Traceback (most recent call last):
 File "C:\Users\ihartsook\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Print Sheets.pushbutton\script.py", line 1699, in <module>
 File "C:\Users\ihartsook\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Print Sheets.pushbutton\script.py", line 670, in __init__
 File "C:\Users\ihartsook\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\forms\_ipy.py", line 177, in __init__
 File "C:\Users\ihartsook\AppData\Roaming\pyRevit-Master\pyrevitlib\pyrevit\forms\_ipy.py", line 202, in load_xaml
Exception: Provide value on 'System.Windows.StaticResourceExtension' threw an exception.

Script Executor Traceback:
System.Xaml.XamlObjectWriterException: Provide value on 'System.Windows.StaticResourceExtension' threw an exception.
 ---> System.Exception: Cannot find resource named 'PrintIndex'. Resource names are case sensitive.
 at System.Windows.StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider)
 at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
 --- End of inner exception stack trace ---
 at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
 at System.Xaml.XamlObjectWriter.Logic_ProvideValue(ObjectWriterContext ctx)
 at System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
 at System.Xaml.XamlObjectWriter.WriteEndObject()
 at Microsoft.Internal.Scripting.Runtime.DynamicXamlReader.LoadComponent(Object scope, DynamicOperations operations, XamlXmlReader reader)
 at Microsoft.Internal.Scripting.Runtime.DynamicXamlReader.LoadComponent(Object scope, DynamicOperations operations, String filename, XamlSchemaContext schemaContext)
 at IronPython.Modules.Wpf.LoadComponent(CodeContext context, Object self, String filename)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
 at Microsoft.Scripting.Interpreter.FuncCallInstruction`8.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 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)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`8.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`7.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
 at IronPython.Runtime.FunctionCaller`2.Default3Call2(CallSite site, CodeContext context, Object func, T0 arg0, T1 arg1)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 at IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite`1.CallTarget(CallSite site, CodeContext context, Object inst, T0 arg0)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
 at IronPython.Runtime.Types.PythonType.FastTypeSite`1.CallTarget(CallSite site, CodeContext context, Object type, T0 arg0)
 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
 at Microsoft.Scripting.Interpreter.DynamicInstruction`4.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 IronPython.Compiler.PythonScriptCode.Run(Scope scope)
 at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
 at Microsoft.Scripting.Hosting.CompiledCode.Execute(ScriptScope scope)
 at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)

♻️ To Reproduce

  1. Click Print Sheets

⏲️ Expected behavior

This appears

Image

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

C:\Users\ihartsook>pyrevit env
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Branch: "master" | Version: "6.1.0.26047+2255" | Path: "C:\Users\ihartsook\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "2026 First Customer Ship" | Engine: DEFAULT (2712) | Path: "C:\Users\ihartsook\AppData\Roaming\pyRevit-Master"
master | Product: "2025 First Customer Ship" | Engine: DEFAULT (2712) | Path: "C:\Users\ihartsook\AppData\Roaming\pyRevit-Master"
master | Product: "2024.3.4" | Engine: DEFAULT (2712) | Path: "C:\Users\ihartsook\AppData\Roaming\pyRevit-Master"
==> Installed Extensions
Hutton | Type: Unknown | Repo: "" | Installed: "C:\PyRevitExtensions\Pyrevit\Pyrevit Toolbar\Hutton.extension"
==> Default Extension Search Path
C:\Users\ihartsook\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
C:\PyRevitExtensions\Pyrevit\Pyrevit Toolbar
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
2026 First Customer Ship | Version: 26.0.4.409 | Build: 20250227_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2026\"
2025 First Customer Ship | Version: 25.0.2.419 | Build: 20240307_1300(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2025\"
2024.3.4 | Version: 24.3.40.26 | Build: 20250918_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
==> Running Revit Instances
Error: Object reference not set to an instance of an object.
Run with "--debug" option to see debug messages

C:\Users\ihartsook>

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug that stops user from using the tool or a major portion of pyRevit functionality [class]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions