Page 1 of 1

Project Database Profile: set_data() usage

Posted: Wed Oct 07, 2020 11:18 pm
by LahiruW
Hi,

I'm trying to create profiles in the database via excel sheets using the VE API. I see that there is a set_data method but am struggling to work out how to use it to save the (x,y,formula) values for a daily profile. I know I must call upon save_profiles afterwards, but I'm not sure how to correctly call upon set_data.

Below is a what I think I need to do, but its not working as such.

def setData(proj):
# Creates profile with no values
proj.create_profile("daily", "Test Profile 3")
# Creates profile variable for created profile (using its ID which I found manually)
a_profile = proj.daily_profile('DAY_0122')
# Assign the profile with some values
a_profile = [[12,6,'-'],[13,7,'-']]
# Set and save the data
iesve.VEProject.set_data = True
iesve.VEProject.save_profiles = True

While the above code creates a blank daily profile named "Test Profile 3", it doesn't assign the values I want it to have. I'm guessing set_data needs an ID or Profile Name to refer to? I also don't think I'm assigning the values to the profile correctly.

Below is a link to the set_data api:
https://help.iesve.com/ve2019/methods_d ... 3D&mw=MjQw

I'm using VES 2019.2

Thanks for any assistance.