Use the return value of a Python function in another function
Hi !
I defined a method to get the coordinates of an object. These coordinates I want to use in another function to drag and drop the object. I just do not now how to get the return value of a function.
The reason why I want to use the coordinates in another function is because the object is nor recognized in my first function anymore (dont know why, if you have an idea, that is also welcomed)
Here the function to obtain the coordinates:
def getElectricGridDragDropCoordinates():
ImageRepository.AssetLibraryMenus.Menu_ExternalEnergyNetworks.Click()
MySourceObject = ImageRepository.Assets.ElectricGridConnection
ImageRepository.Assets.ElectricGridConnection.Click()
SourceX = Sys.Desktop.MouseX
SourceY = Sys.Desktop.MouseY
MyDestinationObject = Aliases.SimpsonGui.wndQt5QWindowIcon..widget_placeholderEquipment.ComponentTreeView.qt_scrollarea_viewport
DestinationX = MyDestinationObject.Left
DestinationY = MyDestinationObject.Top
return SourceX, SourceY, DestinationX, DestinationY;
and here the function where I want to use these coordinates:
def dragDrop():
getElectricGridDragDropCoordinates()
Delay(200)
t = tuple(#resultof getElectricGridDragDropCorrdinates )
SX = t[0]
SY = t[1]
DX = t[2]
DY = t[3]
MySourceObject = ImageRepository.Assets.ElectricGridConnection
MySourceObject.Drag(SX,SY,DX + 1, DY + 1)
Thanks a lot in advance :D!