verify-operations.pyโข1.16 kB
"""
Verify the last two operations created
"""
import sys
sys.path.append(r'C:\Users\lrosa\AppData\Local\Programs\Python\Python311\Lib\site-packages')
import win32com.client
# Connect to running Visum instance
visum = win32com.client.Dispatch("Visum.Visum.250")
# Check operations 578 and 579
print("\n๐ Verifica delle ultime operazioni create:\n")
try:
op578 = visum.Procedures.Operations.ItemByKey(578)
type578 = op578.AttValue("OPERATIONTYPE")
print(f"Position 578: OPERATIONTYPE = {type578}")
if type578 == 9:
print(" โ
CORRETTO: Initialize Assignment (Delete)")
else:
print(f" โ ERRORE: Dovrebbe essere 9, invece รจ {type578}")
except Exception as e:
print(f"Position 578: Errore - {e}")
try:
op579 = visum.Procedures.Operations.ItemByKey(579)
type579 = op579.AttValue("OPERATIONTYPE")
print(f"\nPosition 579: OPERATIONTYPE = {type579}")
if type579 == 101:
print(" โ
CORRETTO: PrT Assignment")
else:
print(f" โ ERRORE: Dovrebbe essere 101, invece รจ {type579}")
except Exception as e:
print(f"Position 579: Errore - {e}")
print("\n" + "="*50)