


{"id":368856,"date":"2024-05-28T05:12:03","date_gmt":"2024-05-28T05:12:03","guid":{"rendered":"\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/"},"modified":"2024-05-28T05:12:03","modified_gmt":"2024-05-28T05:12:03","slug":"i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/","title":{"rendered":"I am new to use MATLAB ZOS-API and struggling to execute this file."},"content":{"rendered":"<div class=\"paragraphNode wrappable\"><span class=\"textBox\"><span class=\"textWrapper\">I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don&#8217;t know why this is happening.<\/span><\/span><\/div>\n<div class=\"paragraphNode wrappable\"><span class=\"textBox\"><span class=\"textWrapper\">Here is my code and error,<\/span><\/span><\/div>\n<div class=\"paragraphNode wrappable\">\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">function <\/span><span class=\"textWrapper\">[ r ] = MATLABStandalone_NSC_ray_trace( args )<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">if <\/span><span class=\"textWrapper\">~exist(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;args&#8217;<\/span><span class=\"textWrapper\">, <\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;var&#8217;<\/span><span class=\"textWrapper\">)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> args = [];<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% Initialize the OpticStudio connection<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">TheApplication = InitConnection();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">if <\/span><span class=\"textWrapper\">isempty(TheApplication)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% failed to initialize a connection<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> r = [];<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">else<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-keyword Keyword\">try<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> r = BeginApplication(TheApplication, args);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> CleanupConnection(TheApplication);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-keyword Keyword\">catch <\/span><span class=\"textWrapper\">err<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> CleanupConnection(TheApplication);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> rethrow(err);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">function <\/span><span class=\"textWrapper\">[r] = BeginApplication(TheApplication, args)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">import <\/span><span class=\"textWrapper sh-matlab-string String\">ZOSAPI.*<\/span><span class=\"textWrapper\">;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% creates a new API directory<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> apiPath = System.String.Concat(TheApplication.SamplesDir, <\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;\\API\\Matlab&#8217;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-keyword Keyword\">if <\/span><span class=\"textWrapper\">(exist(char(apiPath)) == 0) mkdir(char(apiPath)); <\/span><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><span class=\"textWrapper\">;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% Set up primary optical system<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> TheSystem = TheApplication.PrimarySystem;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> sampleDir = TheApplication.SamplesDir;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">%! [e02s01_m]<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% Open file<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> testFile = System.String.Concat(sampleDir, <\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;&#8221;D:\\Practice\\Zemax Practice\\Beam_expander-NONSEQ.zos&#8221;&#8216;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> TheSystem.LoadFile(testFile, false);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">%! [e02s01_m]<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">%! [e02s02_m]<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% Create ray trace<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace = TheSystem.Tools.OpenNSCRayTrace();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace.SplitNSCRays = false;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace.ScatterNSCRays = false;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace.UsePolarization = false;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace.IgnoreErrors = true;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace.SaveRays = false;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">%NSCRayTrace.ClearDetectors(0);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% Run ray trace<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace.RunAndWaitForCompletion();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace.Close();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">%! [e02s02_m]<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% Non-sequential component editor<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> TheNCE = TheSystem.NCE;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">%! [e02s03_m]<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% Get detector data<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> data = NET.createArray(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;System.Double&#8217;<\/span><span class=\"textWrapper\">, TheNCE.GetDetectorSize(6));<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> TheNCE.GetAllDetectorData(6, 1, TheNCE.GetDetectorSize(6), data);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> [~, rows, cols] = TheNCE.GetDetectorDimensions(6);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% rotates and flips image to reflect ZOS orientation<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> detectorData = flipud(rot90(reshape(data.double, rows, cols)));<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">%! [e02s03_m]<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-comment Comment\">% Plot<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> close <\/span><span class=\"textWrapper sh-matlab-string String\">all<\/span><span class=\"textWrapper\">;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> figure(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;position&#8217;<\/span><span class=\"textWrapper\">, [50, 150, 700, 600])<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> surf(detectorData);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> axis([1 100 1 100]);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> shading <\/span><span class=\"textWrapper sh-matlab-string String\">flat<\/span><span class=\"textWrapper\">;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> xlabel(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;Column #&#8217;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> ylabel(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;Row #&#8217;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> title(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;Incoherent Illuminance [lm\/cm^2]&#8217;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> colorbar;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> r = [];<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">function <\/span><span class=\"textWrapper\">app = InitConnection()<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">import <\/span><span class=\"textWrapper sh-matlab-string String\">System.Reflection.*<\/span><span class=\"textWrapper\">;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% Find the installed version of OpticStudio.<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">zemaxData = winqueryreg(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;HKEY_CURRENT_USER&#8217;<\/span><span class=\"textWrapper\">, <\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;Software\\Zemax&#8217;<\/span><span class=\"textWrapper\">, <\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;ZemaxRoot&#8217;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">NetHelper = strcat(zemaxData, <\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;\\ZOS-API\\Libraries\\ZOSAPI_NetHelper.dll&#8217;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% Note &#8212; uncomment the following line to use a custom NetHelper path<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% NetHelper = &#8216;C:\\Users\\Documents\\Zemax\\ZOS-API\\Libraries\\ZOSAPI_NetHelper.dll&#8217;;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">NET.addAssembly(NetHelper);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">success = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% Note &#8212; uncomment the following line to use a custom initialization path<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% success = ZOSAPI_NetHelper.ZOSAPI_Initializer.Initialize(&#8216;C:\\Program Files\\OpticStudio\\&#8217;);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">if <\/span><span class=\"textWrapper\">success == 1<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> LogMessage(strcat(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;Found OpticStudio at: &#8216;<\/span><span class=\"textWrapper\">, char(ZOSAPI_NetHelper.ZOSAPI_Initializer.GetZemaxDirectory())));<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">else<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> app = [];<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"> <span class=\"textWrapper sh-matlab-keyword Keyword\">return<\/span><span class=\"textWrapper\">;<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% Now load the ZOS-API assemblies<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">NET.addAssembly(AssemblyName(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;ZOSAPI_Interfaces&#8217;<\/span><span class=\"textWrapper\">));<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">NET.addAssembly(AssemblyName(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;ZOSAPI&#8217;<\/span><span class=\"textWrapper\">));<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% Create the initial connection class<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">TheConnection = ZOSAPI.ZOSAPI_Connection();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% Attempt to create a Standalone connection<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% NOTE &#8211; if this fails with a message like &#8216;Unable to load one or more of<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% the requested types&#8217;, it is usually caused by try to connect to a 32-bit<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% version of OpticStudio from a 64-bit version of MATLAB (or vice-versa).<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% This is an issue with how MATLAB interfaces with .NET, and the only<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% current workaround is to use 32- or 64-bit versions of both applications.<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">app = TheConnection.CreateNewApplication();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">if <\/span><span class=\"textWrapper\">isempty(app)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> HandleError(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;An unknown connection error occurred!&#8217;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">if <\/span><span class=\"textWrapper\">~app.IsValidLicenseForAPI<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> HandleError(<\/span><span class=\"textWrapper sh-matlab-string String\">&#8216;License check failed!&#8217;<\/span><span class=\"textWrapper\">);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> app = [];<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">function <\/span><span class=\"textWrapper\">LogMessage(msg)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">disp(msg);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">function <\/span><span class=\"textWrapper\">HandleError(error)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">ME = MXException(error);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">throw(ME);<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">function<\/span><span class=\"textWrapper\"> CleanupConnection(TheApplication)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% Note &#8211; this will close down the connection.<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% If you want to keep the application open, you should skip this step<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-comment Comment\">% and store the instance somewhere instead.<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">TheApplication.CloseApplication();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper sh-matlab-keyword Keyword\">end<\/p>\n<p><\/span><\/span><strong>Error,<\/strong><\/div>\n<div class=\"lineNode mwRichTextComponentLine\">\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">Beam_expander_NSC_raytrace<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">Found <\/span><span class=\"textWrapper sh-matlab-string String\">OpticStudio at:c:\\program files\\ansys zemax opticstudio 2023 r2.00<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">Unrecognized <\/span><span class=\"textWrapper sh-matlab-string String\">field name &#8220;RunAndWaitForCompletion&#8221;.<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">Error <\/span><span class=\"textWrapper sh-matlab-string String\">in Beam_expander_NSC_raytrace&gt;BeginApplication (line 55)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> NSCRayTrace.RunAndWaitForCompletion();<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\">Error <\/span><span class=\"textWrapper sh-matlab-string String\">in Beam_expander_NSC_raytrace (line 16)<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div class=\"lineNode mwRichTextComponentLine\"><span class=\"textBox\"><span class=\"textWrapper\"> r = BeginApplication(TheApplication, args);<\/span><\/span><\/div>\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<div class=\"lineNode mwRichTextComponentLine\">\n<div class=\"row\">\n<div class=\"col-xs-12\">\n<div id=\"body_question_2123166\">\n<div class=\"rtcContent\">\n<div class=\"SectionBlock\">\n<div class=\"paragraphNode wrappable\"><span class=\"textBox\"><span class=\"textWrapper\">Any help in any regards is much appreciated.<\/span><\/span><\/div>\n<div class=\"paragraphNode wrappable\">&nbsp;<\/div>\n<div class=\"paragraphNode wrappable\"><span class=\"textBox\"><span class=\"textWrapper\">Thank you and regards,<\/span><\/span><\/div>\n<div class=\"paragraphNode wrappable\"><span class=\"textBox\"><span class=\"textWrapper\">Navaneeth<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"comments_question_2123166\" class=\"comments add_padding_top_10\" data-state=\"closed\">\n<h5>&nbsp;&nbsp;<span class=\"comments-count\">0 Comments<\/span><\/h5>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"lineNode mwRichTextComponentLine\">&nbsp;<\/div>\n<\/div>\n<\/div>\n","protected":false},"template":"","class_list":["post-368856","topic","type-topic","status-closed","hentry","topic-tag-zos-api","topic-tag-zos-api-matlab"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don&#039;t know why this is happening.Here is my\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"I am new to use MATLAB ZOS-API and struggling to execute this file. | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don&#039;t know why this is happening.Here is my\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-05-28T05:12:03+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-05-28T05:12:03+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"I am new to use MATLAB ZOS-API and struggling to execute this file. | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don&#039;t know why this is happening.Here is my\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/zos-api\\\/#listItem\",\"name\":\"ZOS-API\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/zos-api\\\/#listItem\",\"position\":3,\"name\":\"ZOS-API\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/zos-api\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\\\/#listItem\",\"name\":\"I am new to use MATLAB ZOS-API and struggling to execute this file.\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\\\/#listItem\",\"position\":4,\"name\":\"I am new to use MATLAB ZOS-API and struggling to execute this file.\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/zos-api\\\/#listItem\",\"name\":\"ZOS-API\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\\\/\",\"name\":\"I am new to use MATLAB ZOS-API and struggling to execute this file. | Ansys Learning Forum\",\"description\":\"I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don't know why this is happening.Here is my\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\\\/#breadcrumblist\"},\"datePublished\":\"2024-05-28T05:12:03+00:00\",\"dateModified\":\"2024-05-28T05:12:03+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"I am new to use MATLAB ZOS-API and struggling to execute this file. | Ansys Learning Forum","description":"I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don't know why this is happening.Here is my","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/forum\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/zos-api\/#listItem","name":"ZOS-API"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/zos-api\/#listItem","position":3,"name":"ZOS-API","item":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/zos-api\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/#listItem","name":"I am new to use MATLAB ZOS-API and struggling to execute this file."},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/#listItem","position":4,"name":"I am new to use MATLAB ZOS-API and struggling to execute this file.","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/zos-api\/#listItem","name":"ZOS-API"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/","name":"I am new to use MATLAB ZOS-API and struggling to execute this file. | Ansys Learning Forum","description":"I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don't know why this is happening.Here is my","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/#breadcrumblist"},"datePublished":"2024-05-28T05:12:03+00:00","dateModified":"2024-05-28T05:12:03+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"I am new to use MATLAB ZOS-API and struggling to execute this file. | Ansys Learning Forum","og:description":"I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don't know why this is happening.Here is my","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/","article:published_time":"2024-05-28T05:12:03+00:00","article:modified_time":"2024-05-28T05:12:03+00:00","twitter:card":"summary_large_image","twitter:title":"I am new to use MATLAB ZOS-API and struggling to execute this file. | Ansys Learning Forum","twitter:description":"I am trying to carry non-sequential raytracing on a system of mine, I tried using a predefined script that works very well on an existing system but when I replace this with my system I am facing some errors. I am not able to resolve them and don't know why this is happening.Here is my"},"aioseo_meta_data":{"post_id":"368856","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"content","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2024-10-28 16:40:25","updated":"2024-10-28 16:40:25","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/zos-api\/\" title=\"ZOS-API\">ZOS-API<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tI am new to use MATLAB ZOS-API and struggling to execute this file.\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/forum\/topics\/"},{"label":"ZOS-API","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/zos-api\/"},{"label":"I am new to use MATLAB ZOS-API and struggling to execute this file.","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/i-am-new-to-use-matlab-zos-api-and-struggling-to-execute-this-file\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["39411","50911"],"_bbp_author_ip":["23.216.133.155"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["555"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["368856"],"_bbp_forum_id":["27816"],"_bbp_engagement":["39411","50911"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["371287"],"_bbp_last_active_id":["371287"],"_bbp_last_active_time":["2024-07-10 09:22:53"]},"test":"8f2579260c0094453bc7ffdef72ea58e9de3f865"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/368856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/368856\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=368856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}