Jump to content

Image from Measuring Setups in Dialog


Recommended Posts

Hallo,

ich möchte einen Dialog erstellen, der den Messaufbau anzeigt. Wie ich den Text aus dem Messaufbau auslese, habe ich bereits herausgefunden. Nun hänge ich mal wieder daran, das Bild abzurufen und im Dialog anzuzeigen.
Wie kann ich mir das Bild aus dem Messaufbau in meinem Dialog anzeigen lassen? Kennt jemand dafür eine unkomplizierte Lösung?

gom.app.project.measuring_setups['Messaufnahme 07-37D 378005'].instruction_image

 

English

I want to create a dialog that displays the measurement setup. I’ve already figured out how to read the text from the measurement setup. However, I’m stuck again on retrieving the image and displaying it in the dialog.
How can I show the image from the measurement setup in my dialog? Does anyone know a simple solution for this?

gom.app.project.measuring_setups['Messaufnahme 07-37D 378005'].instruction_image

image.png.2d00acc47ea5ffaba4129855c8d6d4f3.png

image.thumb.png.c925efa7d1a4d46c1195a93ded6996d9.png

# -*- coding: utf-8 -*-

import gom

text=gom.app.project.measuring_setups['Messaufnahme 07-37D 378005'].instruction_text
bild=gom.app.project.measuring_setups['Messaufnahme 07-37D 378005'].instruction_image



RESULT=gom.script.sys.execute_user_defined_dialog (dialog={
	"content": [
		[
			{
				"columns": 1,
				"data": "AAAAAA==",
				"file_name": "bild",
				"height": 0,
				"keep_aspect": True,
				"keep_original_size": True,
				"name": "bild",
				"rows": 1,
				"system_image": "system_message_warning",
				"tooltip": {
					"id": "",
					"text": "",
					"translatable": True
				},
				"type": "image",
				"use_system_image": False,
				"width": 0
			}
		],
		[
			{
				"columns": 1,
				"name": "text",
				"rows": 1,
				"text": {
					"id": "",
					"text": text,
					"translatable": True
				},
				"tooltip": {
					"id": "",
					"text": "",
					"translatable": True
				},
				"type": "label",
				"word_wrap": False
			}
		]
	],
	"control": {
		"id": "OkCancel"
	},
	"embedding": "",
	"position": "",
	"size": {
		"height": 135,
		"width": 239
	},
	"sizemode": "",
	"style": "",
	"title": {
		"id": "",
		"text": "Dialogtitel",
		"translatable": True
	}
})

 

 


 

Link to comment
https://qualityforum.zeiss.com/topic/25081-image-from-measuring-setups-in-dialog/
Share on other sites

you're going to want an extendable break dialog, (external file or embedded is your choice) 

image.thumb.png.494237caa2524647c373700df11d7291.png


you'll probably have to use the size parameters(image.width / image.height)  to set it properly, see the docstring or 

https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/howtos/python_api_introduction/user_defined_dialogs.html#image-widget
 

×
×
  • Create New...