Revit API : "PickObject" not displaying dialog window -
i did written here, got problem __window__.topmost = true
.
(so, i'm running directly shell)
here complete code :
def test(self) : __window__.hide() sel = __revit__.activeuidocument.selection pickedref = sel.pickobject(objecttype.element, "please select group"); __window__.show() __window__.topmost = true return pickedref
indeed, if that, got error message saying 'return' outside function. if change 'return' line else, elem = element.getgeometryobjectfromreference(pickedref)
, says there unexpected indent (of course checked indentation, should ok normally).
finally, if comment __window__.topmost
line, got no error message.
do experience problems ?
but biggest issue in end, select element, see no dialog window popping expected message "please select group"). come ? guess "topmost" command brings shell on top, doesn't come that...
any clue ?
thanks lot !
i answered comment in french on website : here
pickobject method not supposed make window popping up. shows message @ bottom left corner, check image : ! revit extract message
here working code :
def pickobject(): autodesk.revit.ui.selection import objecttype __window__.hide() picked = uidoc.selection.pickobject(objecttype.element, "select object") __window__.show() __window__.topmost = true return picked
moreover, not supposed add "self" in context. return following error : traceback (most recent call last): file "", line 1, in typeerror: pickobject() takes 1 argument (0 given)
Comments
Post a Comment