Comments (5)
I've solved the issue by continuously renaming the saved .jpg file via python itself, it's not pretty but it works. Maybe there's a better way to do this, but I'm happy for now:)
from pyzdde.
Hi @Toniostado,
I am sorry that I couldn't respond to you earlier. The ipzCaptureWindow()
function was designed to work in an IPython environment only. The ipzCaptureWindow()
function internally uses GetMetaFile
DDE command, which Zemax has removed in recent versions of OpticStudio. So, going forward, I imagine that the only way to dump images automatically from Zemax is by using macros (which I don't really like myself exactly because of the limitations that you have mentioned).
Also, you are right that one cannot change the macro to specify a filename, etc. That is a limitation imposed by Zemax, unfortunately, and so we probably cannot do much about it from PyZDDE.
I am not sure if there is any other more efficient way to circumvent this problem other than what you have done.
Since, you seem to have resolved your problem for now, I will go ahead and close this issue.
from pyzdde.
I am trying to do the same thing, however when I try to ExecuteZPLMacro('xyz') I get either -999 or -1 return code.
I am able to use the 'CALL MACRO' operand in Zemax and run the secondary macro, but unable to do so in PyZDDE
from pyzdde.
@shbhuk The errors you are seeing could be due to a couple of reasons. Where does the zpl macro file which you are trying to execute reside? Is it in the default location (i.e. in C:\Users\xxx\Documents\Zemax\Macros
)? If not then you got to do two things:
- Change the folder location in Zemax (Setup >> Project Preferences >> Folders >> ZPL) to the appropriate location, and also
- Use the PyZDDE function
zSetMacroPath()
to set the macro path to the same folder as 1.
See the example below (I just executed in Jupyter Console and OpticStudio 16.5):
from pyzdde.
The .zpl file is in the default Macro location.
from pyzdde.
Related Issues (20)
- Assembling zSetField return tuple in Opticstudio 17.5 broken HOT 1
- WindowsError: [Error 126]
- Problem getting RMS Field Map Data out as a Text File HOT 3
- which versions of zemax are compatible
- Error message : UTF-16 stream does not start with BOM HOT 1
- Error of zGetSurfaceData HOT 1
- Which Zemax version is required?
- Closing ZRD file before raising Exception in pyzdde.zfileutils.readZRDFile
- PyZDDE giving different results than Zemax HOT 3
- zSetField not working HOT 3
- Is the NOBJ(surface) command supported? HOT 1
- zSetNSCProperty(1, 1, 0, 86, "1,2,1") to set the wavelength shift string doesn't work HOT 11
- Is there a set glass data functionality? HOT 5
- Zemax subscription model breaks DDE - fixed promised by Zemax HOT 5
- zGetImageSimulation not working HOT 2
- Problem getting zGetZernike about list indices HOT 12
- ERROR: Unable to establish a conversation with server (err=0x400a). HOT 5
- GetPSF with OpticStudio 20.3.1
- ZBF file created with PyZDDE
- ImportError: bad magic number in 'pyzdde.arraytrace': b'\x03\xf3\r\n' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyzdde.