fusion-energy / openmc_geometry_plot

Create axis slice plots of OpenMC geomtry with specified zoom
6 stars 0 forks source link

adding option to write xml input #27

Open shimwell opened 9 months ago

shimwell commented 9 months ago

We could have a text input that can be changed and used to generate the geometry.xml

    def save_text_area_to_file():
        text_area = st.session_state.text_area
        print(text_area)
        with open('geometry.xml', "w") as f:
            f.write(text_area)
        return st.success(f"Saved File to geometry.xml")

text_area = st.text_area(label='geometry xml input box',on_change=save_text_area_to_file, key='text_area')