Question

Thickness, comment. etc. cell values not accessible pythonnet3

  • 22 January 2024
  • 1 reply
  • 22 views

I have upgraded to pythonnet 3 and I cannot find any way to access the values of the cells. I seem to be able to set the focus but I cannot read the value out.

focus = 5

foc_adj = TheSystem.LDE.GetSurfaceAt(5) 
foc_adj.Thickness = focus  
 

 

Cell In[141], line 1----> 1 foc_adj.ThicknessNullReferenceException: Object reference not set to an instance of an object.Server stack trace:    at ZemaxUI.ZOSAPI.Editors.ZOSAPI_LDETools.GetCellValue(Int32 rowIndex, Int32 col)   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)   at ZemaxUI.ZOSAPI.Editors.IZOSAPI_LDETools.GetCellValue(Int32 rowIndex, Int32 col)   at ZemaxUI.ZOSAPI.Editors.ZOSAPI_EditorCellBase.get_DoubleValue()

1 reply

Sorry all. Please ignore. I was trying to read a none existent file.

Reply