Advanced Corrugated Materials

Advanced Corrugated Materials
 1ot = impact.gui.output_toolbox
 2
 3
 4def describe_corrugated_material(cor_mat):
 5    if cor_mat is None or (hasattr(cor_mat, "isNone") and cor_mat.isNone()):
 6        return
 7
 8    if not cor_mat.valid_base_material:
 9        ot.add("Invalid base material")
10        return
11
12    comps = cor_mat.components
13
14    for comp in comps:
15        ot.add("Label text = " + str(comp.label_text))
16        ot.add("Available materials:")
17        mats = comp.available_material_names
18
19        for j in range(0, len(mats) - 1  + 1):
20            ot.add("   " + str(mats[j]))
21
22        if comp.selected_material_index > -1:
23            sel = mats[comp.selected_material_index]
24        else:
25            sel = "NULL"
26
27        ot.add("Selected material = " + str(sel))
28        ot.add("Hint = " + str(comp.hint))
29
30        if comp.use_wax:
31            ot.add("Do use wax")
32        else:
33            ot.add("Do not use wax")
34
35        ot.add("")
36
37    for info_row in cor_mat.info_rows:
38        ot.add(str(info_row.label_text) + " -> " +  + info_row.value_text)
39
40    ot.add("")
41
42ot.clear()
43db = impact.active_database
44sc = db.standard_creator
45cor_mat = sc.corrugated_material
46
47sc.standard = "ECO Pizza Box"
48mats = sc.valid_material_master_settings
49
50for mat in mats:
51    ot.add(mat.full_name)
52
53
54if sc.advanced_corrugated_materials_enabled:
55    sc.material_name = "Corrugated|A Flute"
56    ot.add("***************************************")
57    ot.add("Corrugated|A Flute")
58    ot.add("***************************************")
59    describe_corrugated_material(cor_mat)
60
61    sc.material_name = "Corrugated|B Flute"
62    ot.add("***************************************")
63    ot.add("Corrugated|B Flute")
64    ot.add("***************************************")
65    describe_corrugated_material(cor_mat)
66
67    sc.material_name = "Corrugated|C Flute"
68    ot.add("***************************************")
69    ot.add("Corrugated|C Flute")
70    ot.add("***************************************")
71    describe_corrugated_material(cor_mat)
72
73else:
74    ot.add("Advanced materials are not enabled")