I just did what is written here, but I got a problem with __window__.Topmost = True
.
(So, I'm running directly from the Shell)
Here is my complete code :
def Test(self) :
__window__.Hide()
sel = __revit__.ActiveUIDocument.Selection
pickedRef = sel.PickObject(ObjectType.Element, "Please select a group");
__window__.Show()
__window__.Topmost = True
return pickedRef
Indeed, if I do that, I got an error message saying that 'return' is outside function. If I change the 'return' line with something else, like elem = Element.GetGeometryObjectFromReference(pickedRef)
, then it says that there is an unexpected indent (of course I checked indentation, should be ok normally).
Finally, if I comment the __window__.Topmost
line, then I got no error message.
Do you also experience problems with that ?
But then my biggest issue is that in the end, I get to select an element, but I see no dialog window popping up with the expected message "please select a group"). Where does that come from ? I guess the "topmost" command just brings back the shell on top, so it doesn't come from that...
Any clue ?
Thanks a lot !