In a macro I use
Code: Select all
DrafTools.Rectangle
Code: Select all
...
r=None
r = DraftTools.Rectangle().Activated()
###Here it should wait, till rectangle is finished
print("Rectangle finished") # This appears immediately before the rectangle exists
... something with r, which causes error, because r does not exist yet
An Observer that watches keyboard and mouse and checks, weather "r" is not None
(Or weather "rec" is not None - When the rectangle is finished, it can be accessed by global variable rec, made by DraftTools)
Or is there a better solution?