assembly_handbook/ahb_material.py

25 lines
647 B
Python
Raw Normal View History

class Material:
def __init__(self, ID, density):
self.ID = ID
self.density = density
DB = []
@staticmethod
def GetMaterialIDs():
result = []
for m in Material.DB:
result.append(m.ID)
return result
@staticmethod
def Get(ID):
for m in Material.DB:
if m.ID == ID: return m
return None
Material.DB.append(Material('Stainless steel', density = 8.00))
Material.DB.append(Material('Aluminium', density = 2.71))
2024-05-07 20:59:13 +01:00
Material.DB.append(Material('Wood (pine)', density = 0.55))
Material.DB.append(Material('Plywood', density = 0.6))