Modifying Existing Profiles

The VE Python API allows users create simple programs using the Python Programming Language, to interact with a VE Model and/or Vista Results File
Post Reply
User avatar
Complex Potential
VE Expert
VE Expert
Posts: 467
Joined: Wed Jan 09, 2013 11:57 am
Location: Bristol, UK

Modifying Existing Profiles

Post 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
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: Modifying Existing Profiles

Post 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()
User avatar
Complex Potential
VE Expert
VE Expert
Posts: 467
Joined: Wed Jan 09, 2013 11:57 am
Location: Bristol, UK

Re: Modifying Existing Profiles

Post by Complex Potential »

Many thanks

That sounds like just what I need.
Post Reply