How to highlight an element before the end of Execute()

How to highlight an element before the end of Execute()

Anonymous
Not applicable
1,203 Views
3 Replies
Message 1 of 4

How to highlight an element before the end of Execute()

Anonymous
Not applicable

My plugin will show a Window Form with different room properties listed on it. What I want is to highlight anroom when I select this room from GUI. Is there any simple way to do it?

 

The method mentioned in this blog (http://thebuildingcoder.typepad.com/blog/2010/06/highlight-elements.html) can highlight an element only after the Execute() function is finished. However, I want the element to be highlighted in between (i.e., Window Form GUI is still running and a room can be hilghlighted by selecting this room from this GUI)

 

Thanks,

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

Anonymous
Not applicable
Accepted solution

You can build a selection like so :

_commandData.Application.ActiveUIDocument.Selection.Elements.Add(Room);

 

and then use :
_commandData.Application.ActiveUIDocument.RefreshActiveView();

 

This will highlight the selected elements (or rooms in this case).

 

No need to close the dialog.

 

Hope this helps,

0 Likes
Message 3 of 4

PhillipM
Advocate
Advocate
I believe what you will have to do is create a modeless form ie myForm.Show() and then create an ExternalEvent class and subscribe to it so that any interaction you have with Revit passes through that. That is the only safe way to do what you are wanting. Check out the ModelessDialog example in the SDK to get you started. Cheers Phillip
0 Likes
Message 4 of 4

Anonymous
Not applicable

This doesn't seem to work anymore? I think the the kiwi coder was right

0 Likes