Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving after connect_as_extension #41

Closed
LucVV opened this issue Sep 25, 2023 · 1 comment · Fixed by #62
Closed

Saving after connect_as_extension #41

LucVV opened this issue Sep 25, 2023 · 1 comment · Fixed by #62
Assignees

Comments

@LucVV
Copy link
Contributor

LucVV commented Sep 25, 2023

As noted on the Zemax forum, an error is currently raised when trying to use OpticStudioSystem.Save after connecting as extension. In this specific case, the private property _OpenFile is kept as None.

I can see two ways to fix this:

  1. Set the _OpenFile property directly after connecting as extension
  2. Dropping the 'OpenFile' attribute all together and directly checking OpticStudioSystem.SystemFile. As this is a private property, I would not directly consider it a breaking change.

It might be good to address this when addressing #34

@crnh
Copy link
Collaborator

crnh commented Jan 10, 2024

I am currently looking into this and am not sure how to handle it.

  1. is my preferred option, which can be implemented when we introduce the new connection methods.
  2. doesn't seem to be necessary, because OpticStudioSystem.SystemFile is always set (to e.g. <Zemax SAMPLES directory>/Lens.zmx). We can choose to drop the attribute and perform no checks at all.
  3. It is also possible to issue a warning if _OpenFile is None, but still save the file.

What do you think?

@crnh crnh self-assigned this Jan 10, 2024
@crnh crnh closed this as completed in #62 Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants