Preview Wall

Preview Wall

vanlion
Advocate Advocate
633 Views
4 Replies
Message 1 of 5

Preview Wall

vanlion
Advocate
Advocate

Hi,

 

I'm looking for the way you can create a preview of a wall like the picture below when you make a wall (see image)

 

I know how to do this for a normal 3d view, nice explanation at the link below. But how can you do this for a small part of a wall? Maybe someone knows a good example? i couldn't find one.

 

Thanks

 

https://spiderinnet.typepad.com/blog/2014/12/revit-net-api-preview-control-previewcontrol-pt-8-use-w...

 

Annotation 2019-06-20 101152.png

0 Likes
634 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Inside the preview control, the user can zoom in.

 

I am not sure whether you can preset the zoom and crop programmatically before displaying it to the user, though...

  

Here are some other discussions of the preview control:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.7

 



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

Message 3 of 5

Anonymous
Not applicable

The following code works for me:

private void CylinderVerificationForm_ContentRendered(object sender, EventArgs e) {
  pc.UIView.ZoomToFit();
}

Here, pc is the PreviewControl that's embedded in the form. I am executing the function on the form's ContentRendered event. The function sets the zoom to fit. In your case, you may want to use ZoomAndCenterRectangle() method instead. Hope this helps!

Message 4 of 5

vanlion
Advocate
Advocate

Hi,

 

Thank you both for helping. I going to try your option. 

 

And maybe this isn't possible with the api. The preview let's you see a small 2d part of a wall. When you add a new layer to the wall the preview directly show you the new wall you are creating.

Maybe you know this?

0 Likes
Message 5 of 5

vanlion
Advocate
Advocate

Hi,

 

I think that i found an example from the thing i'm looking for in the SDK

 

"newOpenings" example shows a simple 2d image when you select a floor or wall. This is what i can use with my code.

 

Thanks

0 Likes