How can I leave from PickObject without ESC?

How can I leave from PickObject without ESC?

AndrewButenko
Advocate Advocate
455 Views
2 Replies
Message 1 of 3

How can I leave from PickObject without ESC?

AndrewButenko
Advocate
Advocate

Hello!

Does anyone know how I can leave PictoObject some time after it's started?

For example, in my code, if the user hasn't done anything for 4 seconds, I want to exit the while. In this case, this must be done without pressing the ESC

 

 

Try
 While (True)
    R = uidoc.Selection.PickObject(ObjectType.PointOnElement, selFilter, pickPointText)
 End While
            Catch ex As Exception

            End Try

 

 

 Help.

0 Likes
456 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor

That kind of thing isn't possible unless you perhaps set a timer on another thread to send keys etc. Once you call PickObject Revit is waiting for the user to pick something or cancel via escape or context menu.

 

Surely the user doesn't want to wait for an elapsed time? Sounds a bit like mitigation used in one of those installation programs: where you leave it running, come back in an hour to find it asking you a question that popped up 55 minutes ago.

 

 

 

 

Message 3 of 3

sragan
Collaborator
Collaborator

Is there some reason you can't use "PickObjects"?

 

That provides a "Finish" button on the upper left of the screen for the user to select when they are done selecting elements.   

 

Or does PickObject have the same thing?

 

Nevermind.  I see you are picking points, not elements.

 

The user can't right click and select "Cancel" for some reason?  That returns to running the rest of the code.

 

 

0 Likes