Solved

why not all the dat files are shown in the object explorer of the source in non-sequential mode

  • 26 April 2023
  • 6 replies
  • 188 views

Dear all,

 

I want to use a dat file as my source file in non-sequential mode. I have placed the file in the specified folder (Documents\Zemax\Objects\Sources\Source Files). However, when I want to select the file in the object editor for the source file, I cannot find the file. So, I am wondering why not all the dat files are shown in the data file of the object explorer (see the highlighted part in the attached picture)?

 

Thanks in advance and best regards,

Maryam

 

icon

Best answer by Chris Normanshire 2 May 2023, 15:53

View original

6 replies

Userlevel 3
Badge +2

@Maryam as you followed up with a private support case, I’m going to mark this post as answered.

@Chris Normanshire 

I have the same question. Can you please share how you helped Maryem in her case?

Userlevel 1

I had the same issue but figured it out.

If you have a text file in \Objects\Sources\Source Files folder and can’t see it the issue my be how you renamed the extension. According to the help file I copied and pasted below it looks like you can change the .txt by right clicking and adding a .SDF or .DAT to the name. However this doesn’t seem to work in recent windows versions.

I think the reason for this is because Windows in surpassing the .TXT so you can’t delete it. Instead open the file in notepad by just double clicking it. Then “Save As”, then go to save type and change it from “.txt” to  “All Files”, add the .sfd to the file name and click save. Note that I used the encoding UFT-8. Some other encodings cause Zemax to crash.

See image below.

 

 

“The Source File is a source whose ray coordinates, cosines, and intensity are defined in a user supplied file. The name of the file containing the ray data must be placed in the comment column of the object. The file extension may be either DAT or SDF and the file must be placed in the <data>\Objects\Sources\Source Files folder (see “Folders” ). The extension SDF is recommended and DAT is supported only for backward compatibility. The file format may be either text or binary, both formats are described below.”

 

Note that you can stop windows from suppressing the file extensions by clicking view and clicking a check box so they are visible as was the default case in older windows versions. 

I had the same issue but figured it out.

If you have a text file in \Objects\Sources\Source Files folder and can’t see it the issue my be how you renamed the extension. According to the help file I copied and pasted below it looks like you can change the .txt by right clicking and adding a .SDF or .DAT to the name. However this doesn’t seem to work in recent windows versions.

I think the reason for this is because Windows in surpassing the .TXT so you can’t delete it. Instead open the file in notepad by just double clicking it. Then “Save As”, then go to save type and change it from “.txt” to  “All Files”, add the .sfd to the file name and click save. Note that I used the encoding UFT-8. Some other encodings cause Zemax to crash.

See image below.

 

 

“The Source File is a source whose ray coordinates, cosines, and intensity are defined in a user supplied file. The name of the file containing the ray data must be placed in the comment column of the object. The file extension may be either DAT or SDF and the file must be placed in the <data>\Objects\Sources\Source Files folder (see “Folders” ). The extension SDF is recommended and DAT is supported only for backward compatibility. The file format may be either text or binary, both formats are described below.”

 

Note that you can stop windows from suppressing the file extensions by clicking view and clicking a check box so they are visible as was the default case in older windows versions. 

 

I am using the Ansys Zemax OpticStudio 2023 R1.03. It doesn’t works. What is listed in the pull down menu is the default source files that come with Zemax.

 

The rest not listed in the pull down menu. 

 

Does the file size matter? Seem like file size above 1GB is not support. I did contact support for help and sent one of the huge DAT file to them. They can load the file. Something to do with my system, but what is it?

It was working fined until don’t know when it started.

Userlevel 1

Trying changing the extension to SDF instead of DAT. You want windows to associate the file with Zemax (like your CREE_XTE_1m.SDF, Sample.SDF, and VMNN110CMS.SDF in your image). Notice that all you .dat file still default to notebook. Once I changed the extension in the method above the association changed to Zemax in the windows explorer. 

Userlevel 1

You could also try copying their default cases and see if the copy show up. Then past over the copy’s data in notebook with your own ray set and see if you can load it. 

Reply