Skip to main content

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 Inl141], 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, Objectb] args, Object server, Objectb]& outArgs)   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)Exception rethrown at n0]:    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()

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


Reply