Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 67020

Copy size / location of CropBox from one view to another

$
0
0

Hello,

 

I have a plugin that is currently taking the active view (sheet) and finding the associated views (always a ViewPlan). 

From there the intent is to make a duplicate sheet, and views of the original on a new level.

to summarize:

Original Sheet: A-1

Original View: View-1 (Level 1)

 

New Sheet A-1-Duplicate

New View: View-1-Duplicate (Level 2)

 

My problem is when I try to define the Crop Box of the duplicated view. Revit seems to be ignoring the boundingBox that I assign to the new view. 

I've tried many different things, but here are some of the attempts that I thought shouldn't have definitely worked...

[Revit 2016 - R2]

 

// try 1
newView.CropBox = ev.CropBox;

//try 2
BoundingBoxXYZ oBox = ev.CropBox;
newView.CropBox = oBox;

//try 3
BoundingBoxXYZ oBox = ev.CropBox;
XYZ oBoxMin = oBox.Min;
XYZ oBoxMax = oBox.Max;

BoundingBoxXYZ box = new BoundingBoxXYZ();
box.Min = oBoxMin; 
box.Max = oBoxMax;
newView.CropBox = oBox;




Any ideas on how my approach is incorrect?

Any help would be greatly appretiated.

 

Thank you!


Viewing all articles
Browse latest Browse all 67020


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>