Request for custom solution names using the ZOS-API

  • 14 January 2021
  • 2 replies
  • 18 views

Userlevel 7
Badge +2

Hi Zemax team,


Correct me if I'm wrong but when I use a New User Operand Template - C# (and the same apply to the other ZOS-API mode using C#/C++). A Visual Studio solution gets created for me, and its name starts as CSharpUserOperandApplication, and progressively gets incremented with a number at the end. If I create five different User Operand, I'll have the following folders in my Zemax\ZOS-API Projects:



  • CSharpUserOperandApplication

  • CSharpUserOperandApplication1

  • CSharpUserOperandApplication2

  • CSharpUserOperandApplication3

  • CSharpUserOperandApplication4


This is not informative, and error-prone. Moreover, changing the solution name in Visual Studio is not obvious, unless I'm mistaken again.


Would it be possible to be prompted with a dialog box before the solution is created, such that one can input a custom solution name? Let me know if this isn't clear.


The solution I've settled for so far is, whenever I create a new User Operand, I copy the automatically generated folder with the generic name into another folder with a more approriate name. This is not convenient, and the solutions still have a generic name that is difficult to search.


Please let me know if you have other tips with managing your ZOS-API files, or if I overlooked some aspects of the software.


Take care,


David


2 replies

Userlevel 6
Badge +2

Hi David!


It's good to hear from you 🙂


I have taken a look, and it seems you can rename the SLN file and parent folder without error. As long as Visual Studio is closed, the SLN file and the folder containing it can be re-named by right-clicking on the current name and selecting Rename from the menu:


 



 


Once that is done, you can re-open the SLN file and see the update to the solution space. Additionally, you can add distinguishing factors to the project itself through the settings. For example, you can update the resulting assembly name by right-clicking on the Project name and navigating to Properties:


 



 


Would something like this work for you? If not, I can create a feature request for the pop-up menu to see if it would be possible!


Alternatively, you could create your own project template using the base settings we provide. Then, you can generate your own solution without going through OpticStudio. There are some instructions on how to do that here: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates?view=vs-2019.


Let me know if any of these methods work for you!


Best,


Allie

Userlevel 7
Badge +2

Hi Allie,


Good to hear from you as well. I hope you and the team are staying safe.


Thank you for taking the time to investigate this issue further. I feel like the template option you propose is exactly what I needed. I'll give it a try, and let you know if it isn't satisfactory.


Great support, as always :)


Have a good weekend,


David

Reply