Skip to content

Instantly share code, notes, and snippets.

@Omnistic
Created May 10, 2021 14:19
Show Gist options
  • Save Omnistic/307ff99564c92d4563533f7514793e4a to your computer and use it in GitHub Desktop.
Save Omnistic/307ff99564c92d4563533f7514793e4a to your computer and use it in GitHub Desktop.
ZOS-API: Save Footprint Diagram results to a text file
# Create a Footprint Diagram analysis
FootprintDiagram = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.FootprintSettings)
# Check the implementation status of this analysis feature in the ZOSAPI
print('Does Wavefront Map have fully-implemented settings?', FootprintDiagram.HasAnalysisSpecificSettings)
# This means the settings needs to be accessed through IAS_.ModifySettings (see Example 17 in the ZOSAPI Syntax Help)
# Retrieve Footprint Diagram results
FootprintDiagramResults = FootprintDiagram.GetResults()
# Save results as text file
MyFileName = 'FootprintDiagramResults.txt'
if FootprintDiagramResults.GetTextFile(TheApplication.SamplesDir + '\\' + MyFileName):
print('Text file created successfully')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment