Loading an image from a document¶
Loading an image from a document¶
1# this example loads an image from an existing document in the database. The customer
2# document is first located then used to create a new graphic image in the drawing
3
4ot = impact.gui.output_toolbox
5
6images = impact.active_drawing.graphic_images
7
8doc = impact.active_drawing.database_item.customer.documents.item("akpack_01.gif")
9
10if not doc.isNone():
11 image = images.load_from_document(doc, False, None)
12
13 if not image.isNone():
14 ot.add("Successfully loaded image from " + str(doc.name))
15
16 else:
17 ot.add("Failed to load image from " + str(doc.name))
18
19else:
20 ot.add("Unable to locate document")
21