Displaying only a single element inside a PreviewControl

Displaying only a single element inside a PreviewControl

kevin.anggrek
Enthusiast Enthusiast
749 Views
3 Replies
Message 1 of 4

Displaying only a single element inside a PreviewControl

kevin.anggrek
Enthusiast
Enthusiast

Hi,

 

I am wondering how to show/shift the focus to a single element inside a PreviewControl in a modal dialog. I know that the PreviewControl can be used to display one of the View Class Objects in Revit, but I can't seem to find a way to only view a single element inside the PreviewControl.

 

In the past, I have used the UIDocument.ShowElements() and its overloads in order to show and zoom into a specific element, do I need to incorporate the UIDocument.ShowElements() into the PreviewControl? If that's the case, how should I do it?

 

Thanks in advance!

0 Likes
750 Views
3 Replies
Replies (3)
Message 2 of 4

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @kevin.anggrek ,

Have a look at these below links

https://forums.autodesk.com/t5/revit-api-forum/previewcontrol-revit-api-zoom-element/td-p/9428583#:~... 

 

https://forums.autodesk.com/t5/revit-api-forum/can-not-get-uiview-of-preivewcontrol/td-p/9121235 

 

I hope these links help you to solve your problem.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

kevin.anggrek
Enthusiast
Enthusiast

Hi @naveen.kumar.t 

 

Thank you for linking me to the links that you have provided.

How can I create a view that only displays a single element?

 

What I am trying to do is I am creating a ComboBox in a Windows Form to let the user to pick an element (e.g. Columns or Beams), and then display the selected element in the PreviewControl. How to create a view that shows only the elements selected from the ComboBox?

 

Thanks!

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni
0 Likes