Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
989 Views, 3 Replies

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

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,

Tags (2)
3 REPLIES 3
Message 2 of 4
R.van.den.Bor
in reply to: Anonymous

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,

Kind regards,
Remy van den Bor
ICN Solutions B.V.
Liked this post or found it usefull, don't forget the Kudo It won't hurt (at least not me).
Message 3 of 4
PhillipM
in reply to: Anonymous

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
Message 4 of 4
Anonymous
in reply to: R.van.den.Bor

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community