-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_layers.py
35 lines (28 loc) · 952 Bytes
/
create_layers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import uuid
from materialsdb import utils
from materialsdb.serialiser import XmlSerialiser
from materialsdb.classes import *
materials = Materials(
company="MyCompany",
companyid=Guid(uuid.uuid4()),
ver=1,
crd=utils.new_tdatetime(),
verXML=3,
material=[],
sig=THexHash("MySignature", ver=1),
publickey=THexHash("MyPublicKey", ver=1),
)
material = Material(
id=Guid(uuid.uuid4()),
type=Materialtype("simple"),
information=Information(Names([TCountryLocalizedString("MyMaterial")])),
layers=Layers([]),
)
layer = Layer(id=Guid(uuid.uuid4()), geometry=[Geometry()], thermal=[], physical=[])
thermal = Thermal(lambda_value=0.04, therm_capa=2.9) # Warning therm_capa in Wh/(kg.K)
physical = Physical(density=30)
layer.thermal.append(thermal)
layer.physical.append(physical)
material.layers.layer.append(layer)
materials.material.append(material)
XmlSerialiser().to_xml(materials, "create_layers.xml")