Reset Label Location for COGO Point

@hbajana
try

# Load the Python Standard and DesignScript Libraries
import sys
import clr

clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AeccDbMgd')

# Importar referencias
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.Civil.DatabaseServices import *

# Entrada: Lista de handles (strings) de los puntos COGO
handles = IN[0]
result = []

adoc = Application.DocumentManager.MdiActiveDocument

with adoc.LockDocument():
    with adoc.Database as db:
        with db.TransactionManager.StartTransaction() as t:
            try:
                for handle_str in handles:
                    # Convertir el string a un objeto Handle
                    #handle = Handle(handle_str)
                    
                    # Obtener el ObjectId usando el Handle
                    obj_id = handle_str.InternalObjectId
                    
                    if not obj_id.IsNull:
                        cogo_point = t.GetObject(obj_id, OpenMode.ForWrite)
                        
                        if isinstance(cogo_point, CogoPoint):
                            cogo_point.ResetLabelLocation()
                            
                        else:
                            result.append(f"Handle {handle_str}: No es un COGO Point")
                    else:
                        result.append(f"Handle {handle_str}: No encontrado")
                
                t.Commit()
                
            except Exception as e:
                result.append(f"Error: {str(e)}")
                t.Abort()

OUT = result

3