Overwriting constructions in database

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

Re: Overwriting constructions in database

Post by Rhind »

There's no direct way of changing a surface type. Surface types are based on the geometry you have in your model.
izzylys
VE Newbie
VE Newbie
Posts: 7
Joined: Fri May 03, 2019 3:45 pm

Re: Overwriting constructions in database

Post by izzylys »

Hello,

This thread was very helpful! I have a few related questions:

1. When setting 'g_value' using 'set_properties()', what exactly is this setting? I have been trying to use it and I can see it setting the 'g_value' by using 'get_properties()', but the g-value in the GUI does not change. What is the difference between these two properties?

2. Calling 'get_g_values()' on a construction object raises an AttributeError:

Code: Select all

AttributeError: 'VECdbConstruction' object has no attribute 'get_g_values'
How should I call this correctly? I wasn't able to find an example in the cdb example scripts.

3. What exactly is the bug with 'set_properties()' on cdb objects? Some clarification on this would be great to understand what I should be looking out for when using it.


Many thanks,
Izzy
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: Overwriting constructions in database

Post by Rhind »

Hi,

1. This is the g-value you see in the 'regulation' tab. 'get_g_values() will give you a dictionary of three g-values, keys are 'bs_en_410', 'building_regulations', 'bfrc'.

2. Should be straightforwardly construction.get_g_values(). What version of the VE are you using? This particular method is not available in older versions of the API.

3. If I remember correctly, the properties were sometimes not retained after you had set them from a script. This was fixed for 2018 FP2.

Hope that helps.
samg
VE Newbie
VE Newbie
Posts: 9
Joined: Wed Feb 21, 2018 11:03 pm

Re: Overwriting constructions in database

Post by samg »

Tian wrote: Fri Apr 05, 2019 9:54 pm 2. I looked at at the sample of assign_to_bodies, and the code below didnt work well, it didnt successfully assign the construction.

Code: Select all

for surface in surfaces:
            # Only proceed to assign a construction if it's external glazing
            if surface.type == iesve.VESurface_type.ext_glazing:                     
                # Get the first glazing construction we can find
                construction = project.get_construction(ids[0], c_class)
                # Assign the glazing construction to the external glazing         
                body.assign_construction(construction, surface)
I printed suface.type and there is no surface type as ext_glazing, so I assumed this is the reason why the construction was not assigned. So I am wondering is there a way to solve this?
Tian, I am having this same issue. There are no surface types which are ext_glazing, and removing the if statement from that piece of code doesn't work (assigning a glazing construction to the surface on which it lies doesn't work - it results in the error "invalid construction type for the surface"). Assigning it to the opening/window object doesn't work either.

It doesn't seem like glazing constructions can be assigned. Have you had any luck?
izzylys
VE Newbie
VE Newbie
Posts: 7
Joined: Fri May 03, 2019 3:45 pm

Re: Overwriting constructions in database

Post by izzylys »

Rhind wrote: Thu May 23, 2019 8:40 am 2. Should be straightforwardly construction.get_g_values(). What version of the VE are you using? This particular method is not available in older versions of the API.
I'm running 2017 and running get_g_values() on a construction object returns an attribute error. Does this function only work in 2018?

Code: Select all

AttributeError: 'VECdbConstruction' object has no attribute 'get_g_values'
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: Overwriting constructions in database

Post by Rhind »

Yes, I think it was new in 2018.
Post Reply