Visual Components 4.10 Python Edit Error

Hello, I’ve been using VC since version 4.4 and I’m currently using version 4.10. However, I’m experiencing a lot of inconvenience because I keep getting the error I haven’t seen and the program has been forced to shut down.
Has anyone discovered the same phenomenon as me?

  1. Simulation reset does not compile after Python script modification
  2. Saving to Ctrl+S in the Python Script window forces VC program shutdown
  3. If I just click X to exit the Python Script window, the Python Script window won’t open after the attachment comes out and the old code modification won’t be saved

The code content of the picture is as follows.

Unhandled exception occurred:System.AggregateException: One or more errors occurred. —> System.InvalidOperationException: Cannot assign script code while executing
at VisualComponents.Revolution.PythonScriptWrapper.SetScriptCode(rIPythonInstanceOwner* owner, String value)
at VisualComponents.Revolution.PythonScriptWrapper.set_Script(String value)
at System.Threading.Tasks.Task.Execute()
— End of inner exception stack trace —
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at VisualComponents.UX.Shared.BusyScope.RunTaskMechanism(Task task, Boolean calledFromDialog)
at VisualComponents.UX.Shared.BusyScope.RunTaskAndCloseWindow(Boolean calledFromDialog)
at VisualComponents.UX.Shared.BusyScope.ShowDialog(Task taskToRun, Task cancelTask)
at VisualComponents.UX.Shared.PythonEditorViewModel.OnDeactivate(Boolean close)
at Caliburn.Micro.Screen.Caliburn.Micro.IDeactivate.Deactivate(Boolean close)
at Caliburn.Micro.WindowManager.WindowConductor.Closed(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Window.OnClosed(EventArgs e)
at System.Windows.Window.WmDestroy()
at System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
—> (Inner Exception #0) System.InvalidOperationException: Cannot assign script code while executing
at VisualComponents.Revolution.PythonScriptWrapper.SetScriptCode(rIPythonInstanceOwner* owner, String value)
at VisualComponents.Revolution.PythonScriptWrapper.set_Script(String value)
at System.Threading.Tasks.Task.Execute()<—

best regards,

Haven’t seen such error myself. Please report it to VC support.
A workaround could be to use external Python editor:

https://help.visualcomponents.com/4.10/Premium/en/English/Setup/Using_external_Python_editor.htm

1 Like

I also have the same problem as the above question.
Is there a solution?
If there is, please let me know.

I haven’t found a solution yet.
However, frequent simulation runs and debugging seem to cause the problem.
If the * mark at the top of the script does not disappear even if you save it in the Python Script window, the problem will occur unconditionally, so you need to save the layout.

Could you record the screen and send it to support system?

I’ll try it, but I can’t give you confidence because I don’t know when the problem will happen.

Try pressing reset. Python script will not compile when simulation is running or on halt.
image

Especially not Windows 10, but Windows 11 is having problems.

Yes, I know, but when I reset the simulation, modify it, and compile it, sometimes I get that problem.

I’m using Windows 10 pro and I get that problem.