Reading Values (Python)

Reading Values (Python)
 1db = impact.active_database
 2
 3def DescribeItem(dbItem):
 4    if dbItem.isNone():
 5        return
 6    values = dbItem.values
 7
 8    for i in range(1, values.field_count + 1):
 9        field = values.field_name(i)
10        val = values.load(field)
11
12        if isinstance(val):
13            impact.gui.output_toolbox.add(field + ": Array of " + str(len(val) - 1 - 0) + " bytes")
14        else:
15            impact.gui.output_toolbox.add(field  + ": " + val)
16
17impact.gui.output_toolbox.clear()
18
19impact.gui.output_toolbox.add("**** Finding Project by Name 'DB Mac Test 1' ****")
20DescribeItem(db.find_item_by_name(ipDrawingType.dtProject, "DB Mac Test 1"))
21
22impact.gui.output_toolbox.add("**** Finding Symbol by Name 'Flute Direction' ****")
23DescribeItem(db.find_item_by_name(ipDrawingType.dtSymbol, "Flute Direction"))