Jump to content

Backprojection in Python script


---
 Share

Recommended Posts

Hey there,

Is there is a Python command with which you can automatically project the lines back onto the scanned component? I am using the sofrware Zeiss Inspect Optical 3D and the Scanner AtosQ.

With kind regards,

Jure Baloh

 

 

 

Edited
Link to comment
Share on other sites

Hi,

You can try to record the manual workflow (see ZEISS Quality Tech Guide) in the script editor. If it is possible to record the command, you can generalize it and use it in scripting. Otherwise the command is not accessible from Python.

Best regards,

Matthias Prinke

Edited
Link to comment
Share on other sites

  • 9 months later...
---

Hello,

unfortunately the recording of this command does not work. Are there other ways to integrate this command into the python code?

With kind regards,

Jure Baloh

Link to comment
Share on other sites

  • 4 weeks later...

Hello !

The command is : gom.interactive.sys.project_elements_on_measuring_object (elements=[gom.app.project.actual_elements['Section 1']

To stop the projection you have to press Escap keyboard key.

If you want to stop the projection through a dialog button you have to emulate the escap key strike on this button 

i.e:

press_key(0x1B)

with the class :

 

class KeyboardInputSimulator:
    """
    Cette classe permet de simuler des entrées clavier en utilisant l'API Windows via ctypes.
    Méthodes :
    -----------
    - __init__() :
        Initialise une instance de la classe et configure la fonction SendInput de l'API Windows.
    - press_key(hex_key_code) :
        Args :
            hex_key_code (int) : Code hexadécimal de la touche à simuler.
        Returns :
    """
    
    def __init__(self):
        self.send_input = ctypes.windll.user32.SendInput

    def press_key(self, hex_key_code):
        """
        Simule l'appui sur une touche du clavier en utilisant le code hexadécimal de la touche.

        Args:
            hex_key_code (int): Code hexadécimal de la touche à simuler.

        Returns:
            None
        """
        extra = ctypes.c_ulong(0)
        ki = KeyBdInput(hex_key_code, 0, 0, 0, ctypes.pointer(extra))
        ii = InputUnion()
        ii.ki = ki  # Affectation correcte

        x = Input(ctypes.c_ulong(1), ii)  # Création correcte de l'objet Input
        self.send_input(1, ctypes.pointer(x), ctypes.sizeof(x))

Link to comment
Share on other sites

 Share

×
×
  • Create New...