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

System.NullReferenceException in PythonTextEditor.Write causing Revit to crash #158

Open
alexworkorb opened this issue Jul 29, 2024 · 2 comments

Comments

@alexworkorb
Copy link

Describe the bug
Sometimes Revit crashes due to a Null pointer exception traced to PythonTextEditor.Write

To Reproduce
Steps to reproduce the behavior:

Expected behavior

Screenshots
image

Windows event log:

Faulting application name: Revit.exe, version: 24.1.11.26, time stamp: 0x64ff47ef
Faulting module name: ntdll.dll, version: 10.0.22621.3733, time stamp: 0x67ca8829
Exception code: 0xc0000374
Fault offset: 0x000000000010c8f9
Faulting process id: 0x0x45E4
Faulting application start time: 0x0x1DAE118D918C487
Faulting application path: C:\Program Files\Autodesk\Revit 2024\Revit.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 79327c40-7a4a-4c0b-bdcb-5102af93c7fa
Faulting package full name: 
Faulting package-relative application ID: 

-----------------------------------
Application: Revit.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
   at System.Text.StringBuilder.Append(System.String)
   at PythonConsoleControl.PythonTextEditor.Write(System.String, Boolean, Boolean)
   at PythonConsoleControl.PythonConsole.ExecuteStatements()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at PythonConsoleControl.PythonConsole.DispatcherThreadStartingPoint()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()


Desktop (please complete the following information):

  • OS: Windows 11 Pro 10.0.22631 Build 22631
  • Revit 2024
  • Revit Python Shell 2.0.2

Additional context
We keep encountering this issue when exporting ViewSections into DWG's (using doc.Export)

@Ianhuuuuang
Copy link

Ianhuuuuang commented Jul 29, 2024 via email

@En2735618974
Copy link

Hello I want to ask, my revit is also 2024 and the revit python shell is the same version, I want to know why there is still no plugin in revit after I install it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants