How to cancel from prompt method in the code?

How to cancel from prompt method in the code?

EyalRELJT
Participant Participant
531 Views
1 Reply
Message 1 of 2

How to cancel from prompt method in the code?

EyalRELJT
Participant
Participant

I am using with this method in my code:
Autodesk.Revit.UI.UIDocument.PromptForFamilyInstancePlacement.

My problam is that with this method, In a single invocation, the user can place multiple instances of the input family type until they finish the placement (with Cancel or ESC or a click elsewhere in the UI).

I want to exit the method after the user places one element.

So i create an event - DocumentChanged, and that's how I can know when the user places an element.
My question is how do I get out of this method (PromptForFamilyInstancePlacement)? Is there any method to do this?
Thanks

0 Likes
Accepted solutions (1)
532 Views
1 Reply
Reply (1)
Message 2 of 2

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @EyalRELJT ,

 

Please take a look at this below link
https://thebuildingcoder.typepad.com/blog/2015/02/sending-escape-to-terminate-a-family-instance-plac... 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network