Is it possible to update Revit view without submitting windows form?

Is it possible to update Revit view without submitting windows form?

Anonymous
Not applicable
636 Views
3 Replies
Message 1 of 4

Is it possible to update Revit view without submitting windows form?

Anonymous
Not applicable

Hi,

 

I have a listview inside of a windows form that I have created through visual studio for my add-in. I am currently able to highlight elements in my Revit file based on what items have been selected in the listview but only o. I am wondering is it possible to have an event (or any method really) which automatically highlights an element based on the corresponding selected listview item with the form still open (that is without having to submit the form)?

 

Cheers,

Filip Karisik.

0 Likes
Accepted solutions (1)
637 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk
Accepted solution

Yes. 

 

You can implement an external event.

 

Trigger it from your modeless form.

 

In the event handler, use the Selection class:

 

http://www.revitapidocs.com/2017/31b73d46-7d67-5dbb-4dad-80aa597c9afc.htm

 

Its SetElementIds method defines and highlights the current selection:

 

http://www.revitapidocs.com/2017/cf8c11bb-f0c7-6d50-cbdf-41d0a010d9d6.htm

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 4

Anonymous
Not applicable
I probably should have designed my code with that in mind from the beginning.

Thanks Jeremy. You've been a great help throughout.
0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk

🙂

 

My pleasure entirely. 

 

Thank you for your appreciation!

 

Good luck with all your add-ins and all your other endeavours!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes