Dec 21 2022

T101-2022 Custom code may require replacement of script call to refresh Editor View with Refresh Section View

BIOVIA Workbook

Technical Note T101-2022

Dec 2022

Custom code may require replacement of script call to refresh Editor View with Refresh Section View

Program

BIOVIA Workbook 2021 SP1, BIOVIA Workbook 2022

Operating Systems

Windows 10 and Windows Server 2019

Description

Custom code that uses the Application.RefreshView() call in .NET code or Python, may cause a screen redraw error, due to code changes starting in Workbook 2021 SP1 HF4 and Workbook 2022 HF2.

The error is displayed as a “Red X” accompanied by the following type of error:

"System.NullReferenceException: Object reference not set to an instance of an object

at TD.SandDock.DocumentLayoutSystem."

 

Resolution

The recommendation is to use section.View.Refresh() or section.Refresh() to refresh the section when needed instead of forcing a full redraw of the Application (i.e. the experiment editor).

If the user encounters the error, switching the layout (Eg.  Continuous to Section), may cause the error message to temporarily go away, and allow the user to continue working.

BIOVIA logged this issue as NBK-34359.

BIOVIA Support

If you have any questions, please contact BIOVIA Support.