<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Mathcad Prime crashes - &amp;quot;An unhandled exception occured. See .log file&amp;quot; in Mathcad Installation</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1031744#M4765</link>
    <description>&lt;P&gt;The AI doesn't quite get it right, but it is correct in that the Exception in python is giving you a clue as to the problem. "Exception: 'int' object is not callable" is to be expected, as&amp;nbsp;&lt;STRONG&gt;worksheet.DefaultCalculationTimeout&lt;/STRONG&gt; is a property, not a function. I.e. it should be operated as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;worksheet.DefaultCalculationTimeout = -1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An alternate approach to this could be to pause calculation after opening the document, make the modifications to the file that you need to, resume calculation, then keep trying to extract the output values until the timeout error stops populating:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;worksheet.PauseCalculation()

# e.g. do stuff
worksheet.set_real_input("input", 1)

worksheet.ResumeCalculation()

error_code = 8  # start with an error code = Timeout
while error_code == 8:
    value, units, error_code = worksheet.get_real_output("out")
    # This loop will be delayed by the calculation timeout settings (and the calculation time of the sheet)
    if error_code == 8:
        print("Waiting for calculation")

print(value)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Aug 2025 22:04:23 GMT</pubDate>
    <dc:creator>tKkagF0R9b19yoW</dc:creator>
    <dc:date>2025-08-29T22:04:23Z</dc:date>
    <item>
      <title>Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1030448#M4751</link>
      <description>I am using Mathcad Prime Release 10.0 and Datecode10.0.0.0&lt;BR /&gt;&lt;BR /&gt;My company uses Python scripts to extract Mathcad Prime data to Excel spreadsheets. The Python code uses the MathcadPy library to extract data to the spreadsheets, but I am continually getting errors when running the code. I have also seen the error popup when running Mathcad Prime normally.&lt;BR /&gt;We create a folder structure of Mathcad Prime files, using relative links to point to the folder/file at the next level up. We have a number of Mathcad sheets in the same folder and they all point to Mathcad files at the directory above , to make a make-shift library of electrical parts/parameters for our application.&lt;BR /&gt;I will randomly see the error pop-up when accessing these files. It is also random, and there is no predictability to the error popping up.&lt;BR /&gt;&lt;BR /&gt;Here are the errors that I faced&lt;BR /&gt;"An unhandled exception occured. See .log file"&lt;BR /&gt;&lt;BR /&gt;Exception data:&lt;BR /&gt;System.Exception: Lisp applying: CallNodeCallback {global} to Engine.NodeCallback, 1419, NODE_READY, System.Collections.Hashtable, System.Collections.Hashtable, True, False; Collection was modified; enumeration operation may not execute. ---&amp;gt; System.InvalidOperationException: Collection was modified; enumeration operation may not execute.&lt;BR /&gt;&lt;BR /&gt;The following files are being opened:&lt;BR /&gt;... (Exception when getting files list: The calling thread cannot access this object because a different thread owns it.)</description>
      <pubDate>Thu, 21 Aug 2025 12:52:24 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1030448#M4751</guid>
      <dc:creator>TC_10696099</dc:creator>
      <dc:date>2025-08-21T12:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1030475#M4754</link>
      <description>&lt;P&gt;I have also attached one of the log files I get when I get this error popup.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 13:52:13 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1030475#M4754</guid>
      <dc:creator>TC_10696099</dc:creator>
      <dc:date>2025-08-21T13:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1030578#M4756</link>
      <description>&lt;DIV id="model-response-message-contentr_6f1dedb1d8111264" class="markdown markdown-main-panel enable-updated-hr-color" dir="ltr"&gt;
&lt;P&gt;This error is a classic software &lt;STRONG&gt;race condition&lt;/STRONG&gt;, which is happening inside Mathcad's calculation engine. It's a timing issue where one part of the program tries to read a list of items while another part is simultaneously trying to change that same list.&lt;/P&gt;
&lt;P&gt;The two key error messages tell the whole story:&lt;/P&gt;
&lt;OL start="1"&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;CODE&gt;Collection was modified; enumeration operation may not execute.&lt;/CODE&gt;&lt;/STRONG&gt;: This is like trying to count a list of items on a piece of paper while someone else is actively erasing and adding new items. The program stops to prevent a crash or data corruption.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;CODE&gt;The calling thread cannot access this object because a different thread owns it.&lt;/CODE&gt;&lt;/STRONG&gt;: This confirms it's a multi-threading problem. One process (a thread) is stepping on the toes of another, which is a common cause of race conditions.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;Why It's Happening in Your Case&lt;/H2&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your setup, which involves a &lt;STRONG&gt;complex structure of linked worksheets&lt;/STRONG&gt; with relative paths and automation via a &lt;STRONG&gt;Python script&lt;/STRONG&gt;, is the perfect environment for this bug to surface.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;When you open a Mathcad file, its calculation engine starts analyzing all the linked files ("includes" or "libraries") to figure out what needs to be calculated.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Your Python script, using &lt;CODE&gt;MathcadPy&lt;/CODE&gt;, is likely opening, reading, and possibly modifying these files very quickly.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;This rapid file access from your script conflicts with Mathcad's own background process that is trying to manage the file dependencies. The two processes "race," and sometimes your script modifies the file list just as the calculation engine is trying to read it, causing the crash.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The randomness occurs because it depends on the precise millisecond timing of your computer's operations, network speed (since you're on a corporate network), and file I/O, which can change every time you run the script.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are several strategies, from simplest to most involved, to resolve this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;1. Slow Down Your Python Script&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the most likely and easiest fix. The script is probably overwhelming Mathcad's file handling. Add a short delay after opening a file and before triggering a calculation or saving.&lt;/P&gt;
&lt;P&gt;In your Python script, add a small sleep after each significant Mathcad operation (like opening a file):&lt;/P&gt;
&lt;DIV class="code-block ng-tns-c2622847893-64 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation"&gt;
&lt;DIV class="code-block-decoration header-formatted gds-title-s ng-tns-c2622847893-64 ng-star-inserted"&gt;&lt;SPAN class="ng-tns-c2622847893-64"&gt;Python&lt;/SPAN&gt;
&lt;DIV class="buttons ng-tns-c2622847893-64 ng-star-inserted"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="formatted-code-block-internal-container ng-tns-c2622847893-64"&gt;
&lt;DIV class="animated-opacity ng-tns-c2622847893-64"&gt;
&lt;PRE class="ng-tns-c2622847893-64"&gt;&lt;CODE class="code-container formatted ng-tns-c2622847893-64" role="text" data-test-id="code-content"&gt;&lt;SPAN class="hljs-keyword"&gt;import&lt;/SPAN&gt; time

&lt;SPAN class="hljs-comment"&gt;# Example within your script loop&lt;/SPAN&gt;
mc.&lt;SPAN class="hljs-built_in"&gt;open&lt;/SPAN&gt;(&lt;SPAN class="hljs-string"&gt;'C:\\path\\to\\your\\file.mcdx'&lt;/SPAN&gt;)
time.sleep(&lt;SPAN class="hljs-number"&gt;2&lt;/SPAN&gt;) &lt;SPAN class="hljs-comment"&gt;# Pauses the script for 2 seconds&lt;/SPAN&gt;
&lt;SPAN class="hljs-comment"&gt;# Now proceed with getting values, calculating, etc.&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="code-editor-container ng-tns-c2622847893-64 hide ng-star-inserted"&gt;
&lt;DIV&gt;
&lt;DIV class="code-editor" data-keybinding-context="5" data-mode-id="plaintext"&gt;
&lt;DIV class="monaco-editor no-user-select  showUnused showDeprecated vs" role="code" data-uri="inmemory://model/5"&gt;
&lt;DIV class="overflow-guard" data-mprt="3"&gt;
&lt;DIV class="margin" role="presentation" aria-hidden="true"&gt;
&lt;DIV class="glyph-margin"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="margin-view-zones" role="presentation" aria-hidden="true"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="margin-view-overlays" role="presentation" aria-hidden="true"&gt;
&lt;DIV&gt;
&lt;DIV class="current-line current-line-margin-both"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="glyph-margin-widgets"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="monaco-scrollable-element editor-scrollable vs" role="presentation" data-mprt="6"&gt;
&lt;DIV class="lines-content monaco-editor-background"&gt;
&lt;DIV class="view-overlays" role="presentation" aria-hidden="true"&gt;
&lt;DIV&gt;
&lt;DIV class="current-line current-line-exact"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="view-rulers" role="presentation" aria-hidden="true"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="view-zones" role="presentation" aria-hidden="true"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="view-lines monaco-mouse-cursor-text" role="presentation" aria-hidden="true" data-mprt="8"&gt;
&lt;DIV class="view-line"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="contentWidgets" data-mprt="1"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="cursors-layer cursor-line-style cursor-solid" role="presentation" aria-hidden="true"&gt;
&lt;DIV class="cursor  monaco-mouse-cursor-text "&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="invisible scrollbar horizontal fade" role="presentation" aria-hidden="true"&gt;
&lt;DIV class="slider"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;CANVAS class="decorationsOverviewRuler" width="23" height="8" aria-hidden="true"&gt;&lt;/CANVAS&gt;
&lt;DIV class="invisible scrollbar vertical fade" role="presentation" aria-hidden="true"&gt;
&lt;DIV class="slider"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV role="presentation" aria-hidden="true"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;TEXTAREA class="inputarea monaco-mouse-cursor-text" tabindex="0" role="textbox" spellcheck="false" wrap="off" data-mprt="7" aria-label="Editor content" aria-required="false" aria-roledescription="editor" aria-multiline="true" aria-autocomplete="both"&gt;&lt;/TEXTAREA&gt;
&lt;DIV class="monaco-editor-background textAreaCover"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="overlayWidgets" data-mprt="4"&gt;
&lt;DIV class="sticky-widget"&gt;
&lt;DIV class="sticky-widget-line-numbers" role="none"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sticky-widget-lines-scrollable"&gt;
&lt;DIV class="sticky-widget-lines" role="list"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="minimap slider-mouseover" role="presentation" data-mprt="9" aria-hidden="true"&gt;
&lt;DIV class="minimap-shadow-hidden"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;CANVAS width="0" height="8"&gt;&lt;/CANVAS&gt;&lt;CANVAS class="minimap-decorations-layer" width="0" height="8"&gt;&lt;/CANVAS&gt;
&lt;DIV class="minimap-slider"&gt;
&lt;DIV class="minimap-slider-horizontal"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="blockDecorations-container" role="presentation" aria-hidden="true"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="overflowingContentWidgets" data-mprt="2"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="overflowingOverlayWidgets" data-mprt="5"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;A 1 or 2-second pause is often enough to let Mathcad's engine stabilize before you ask it to do the next thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;2. Work Locally&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your environment variables show you're using &lt;STRONG&gt;OneDrive&lt;/STRONG&gt; and a corporate domain (&lt;CODE&gt;goldlnk.rootlnka.net&lt;/CODE&gt;). Network latency and file syncing can make these timing issues much worse.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Before running your script&lt;/STRONG&gt;, try copying the entire folder structure from the network/OneDrive location to a simple, local folder (e.g., &lt;CODE&gt;C:\Mathcad_Temp\&lt;/CODE&gt;). Run the script on the local files. This eliminates network lag as a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;3. Simplify File Linking&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Deeply nested relative paths (&lt;CODE&gt;../../library/file.mcdx&lt;/CODE&gt;) can sometimes be harder for applications to track reliably.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Use the "Include Worksheet" Feature:&lt;/STRONG&gt; Instead of just referencing variables from other files, consider using Mathcad's dedicated &lt;CODE&gt;Insert &amp;gt; Include Worksheet&lt;/CODE&gt; feature. It can sometimes be more stable.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Flatten Your Directory:&lt;/STRONG&gt; If possible, reduce the number of parent directory (&lt;CODE&gt;..&lt;/CODE&gt;) lookups. A flatter structure might be easier for the calculation engine to manage.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;4. Check for a Mathcad Update&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are on version &lt;CODE&gt;10.0.0.0&lt;/CODE&gt;. This kind of bug is often fixed in subsequent maintenance releases (e.g., 10.0.1.0 or similar). Check the PTC support website for any available updates for Mathcad Prime 10, as they may have already patched this specific race condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;5. Contact PTC Support&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If none of the above solutions work, this is a bug within Mathcad Prime. Provide PTC support with the &lt;STRONG&gt;exact log file you've shared&lt;/STRONG&gt;. This detailed information is exactly what their developers need to identify and fix the root cause in a future update.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Aug 2025 02:53:21 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1030578#M4756</guid>
      <dc:creator>ppal</dc:creator>
      <dc:date>2025-08-22T02:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1030666#M4758</link>
      <description>&lt;P&gt;Thank you so much. This is very helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try to slow down the scripts to allow for Mathcad to stabilize before trying to access the data.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 11:02:33 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1030666#M4758</guid>
      <dc:creator>TC_10696099</dc:creator>
      <dc:date>2025-08-22T11:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1031462#M4762</link>
      <description>&lt;P&gt;As an update to this thread - I was able to debug our code a little further and I find that the Python scripts are causing Mathcad to crash when we issue the command worksheet.Synchronize().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added a print statement before and after the synchornize() command and the code never gets to the print statement after the command, so it is failing during the synchronize API call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found some information on the Mathcad API for worksheets &lt;A href="https://support.ptc.com/help/mathcad/r8.0/en/index.html#page/PTC_Mathcad_Help/API/Object_Worksheet.html" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like there is an option to change the default calculation time via the&amp;nbsp;&lt;SPAN&gt;DefaultCalculationTimeout(arg) API call, but there isn't a lot of information on this. I also tried issue the command worksheet.DefaultCalculationTimeout(-1) so that the sheet waits indefinetly. I assume that this would make the code wait until the sheet completes synch/recalculation to fix the problem with the Python scripts running too fast before Mathcad finishes calculating, but is that a wrong assumption? Additionally, I seem to get errors "Exception: 'int' object is not callable" due to adding this line in our code. Am I doing something wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is little documentation/help for the Mathcad API so any help is appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 11:00:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1031462#M4762</guid>
      <dc:creator>TC_10696099</dc:creator>
      <dc:date>2025-08-28T11:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1031561#M4764</link>
      <description>&lt;P&gt;This got too complicated for me so I asked an AI engine for help. Attached is a pdf. See if it is of any assistance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 20:50:25 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1031561#M4764</guid>
      <dc:creator>ppal</dc:creator>
      <dc:date>2025-08-28T20:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1031744#M4765</link>
      <description>&lt;P&gt;The AI doesn't quite get it right, but it is correct in that the Exception in python is giving you a clue as to the problem. "Exception: 'int' object is not callable" is to be expected, as&amp;nbsp;&lt;STRONG&gt;worksheet.DefaultCalculationTimeout&lt;/STRONG&gt; is a property, not a function. I.e. it should be operated as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;worksheet.DefaultCalculationTimeout = -1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An alternate approach to this could be to pause calculation after opening the document, make the modifications to the file that you need to, resume calculation, then keep trying to extract the output values until the timeout error stops populating:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;worksheet.PauseCalculation()

# e.g. do stuff
worksheet.set_real_input("input", 1)

worksheet.ResumeCalculation()

error_code = 8  # start with an error code = Timeout
while error_code == 8:
    value, units, error_code = worksheet.get_real_output("out")
    # This loop will be delayed by the calculation timeout settings (and the calculation time of the sheet)
    if error_code == 8:
        print("Waiting for calculation")

print(value)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 22:04:23 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1031744#M4765</guid>
      <dc:creator>tKkagF0R9b19yoW</dc:creator>
      <dc:date>2025-08-29T22:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1032289#M4779</link>
      <description>&lt;P&gt;I have found that the crashes do not seem to be specific to the Python scripts, but they even occur just opening Mathcad Prime normally and issuing the recalculate command (F5). I will get the same error popup, as well as the traceback.log file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if the traceback.log file is any helpful to anyone. It doesn't mean a lot to me.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 16:40:28 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1032289#M4779</guid>
      <dc:creator>TC_10696099</dc:creator>
      <dc:date>2025-09-03T16:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1032395#M4782</link>
      <description>&lt;P&gt;Do you have Multithreading enabled (Calculation Tab -&amp;gt; Calculation Options)?&lt;BR /&gt;If so, try disabling it and retry the recalculate command.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 11:12:28 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1032395#M4782</guid>
      <dc:creator>tKkagF0R9b19yoW</dc:creator>
      <dc:date>2025-09-04T11:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Mathcad Prime crashes - "An unhandled exception occured. See .log file"</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1032476#M4784</link>
      <description>&lt;P&gt;I did not / never had Multithreading enabled in the Calculation optionds.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 18:14:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad-Installation/Mathcad-Prime-crashes-quot-An-unhandled-exception-occured-See/m-p/1032476#M4784</guid>
      <dc:creator>TC_10696099</dc:creator>
      <dc:date>2025-09-04T18:14:10Z</dc:date>
    </item>
  </channel>
</rss>

