How to set the ViewSection BoundaryBox?

How to set the ViewSection BoundaryBox?

ehall8CEK4
Contributor Contributor
290 Views
2 Replies
Message 1 of 3

How to set the ViewSection BoundaryBox?

ehall8CEK4
Contributor
Contributor

I am making a plugin that will create a ViewSection from an ElevationMarker that shows a specified wall.  I would like the plugin to automatically crop the ViewSection so that only the given wall is visible.

 

I have attempted this by getting the BoundingBox of the wall from the newly created ViewSection, and modifying the .Max & .Min slightly before setting the ViewSection's cropbox to it.  However, whenever I do this, I get an "The CropBox is empty" error.  I disable the cropping of the view before before getting the wall's BoundingBox, so the wall should be visible.

 

Creating a BoundingBox from scratch also gives me a "The CropBox is empty" error.

 

Also, how does the BoundingBox of the ViewSection relate to the BuiltInParameter.VIEWER_BOUND_OFFSET_FAR parameter?  It looks like both should be able to set the depth of the view, but does one take precedent over the other?

 

0 Likes
291 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

Does my sample code to create section view parallel to wall fit your needs?

  

https://thebuildingcoder.typepad.com/blog/2012/06/create-section-view-parallel-to-wall.html

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

ehall8CEK4
Contributor
Contributor

Unfortunately I don't think I can use that method to create an ElevationView.

 

I might finally understand where my problem is stemming from.  View BoundingBoxes use a different implementation of the XYZ coordinate system than normal BoundingBoxes.  X is the left and right coords, Y is the height, and Z is depth.

 

Do you know a way to take a normal BoundingBox and transform it into one that can be used in a View BoundingBox?

0 Likes