Page 1 of 1

Modifying Existing Profiles

Posted: Wed Nov 24, 2021 4:51 pm
by Complex Potential
Hi

Is there any way to modify existing profiles (and specifically free form profiles) using the IES API?

I can only find ways to create new profiles and generating another with the same name creates a duplicate rather than overwriting the old one.

Thanks

CP

Re: Modifying Existing Profiles

Posted: Thu Nov 25, 2021 8:43 am
by Rhind
Yes, this is possible. Here's an example script that changes an existing Free-form profile:

Code: Select all

import iesve

existing_ff_profile_id = 'FFRM0033' # Change this to your profile ID
project = iesve.VEProject.get_current_project()
dayprofiles, groupprofiles = project.profiles()

for id, profile in groupprofiles.items():
    if id == existing_ff_profile_id:
        print(profile.reference)
        profile.load_data()
        profile.set_data([[1, 1, 0, 0, 0], [2, 1, 0, 0, 1], [12, 31, 24, 0, 0]])
        profile.save_data()

Re: Modifying Existing Profiles

Posted: Thu Nov 25, 2021 9:25 am
by Complex Potential
Many thanks

That sounds like just what I need.