Describing all images in the drawing¶
Describing all images in the drawing¶
1# this example describes all the images in the
2# active drawing
3
4# get the images collection from the active drawing
5images = impact.active_drawing.graphic_images
6
7# define a local variable for the output toolbox
8ot = impact.gui.output_toolbox
9
10# clear the output toolbox
11ot.clear()
12
13# iterate all the images in the collection
14for image in images:
15
16 # output the properties of the current image in the
17 # output toolbox
18 doc = image.document
19
20 ot.add(" ")
21 ot.add("----- Image ----- ")
22 ot.add("Embedded: " + str(image.embedded))
23
24 if not doc.isNone():
25 if doc.customer is None:
26 ot.add("Project Document: " + str(doc.name))
27 else:
28 ot.add("customer Document: " + doc.name + " (" + str(doc.customer.formatted_name) + ")")
29 else:
30 ot.add("FileName: " + str(image.file_name))
31 ot.add("ReferenceCount: " + str(image.reference_count))
32 ot.add("Width: " + str(image.width))
33 ot.add("Height: " + str(image.height))
34 ot.add("FileSize: " + str(image.file_size))
35 ot.add("EmbeddedSize: " + str(image.embedded_size))
36 ot.add("Type: " + str(image.type))
37 ot.add("Compression: " + str(image.compression))
38
39
40
41
42
43
44
45
46