Message 1 of 21
Modify CropBox of Elevation View
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am having difficulty in modifying the cropbox of an elevation view. The extract code below will place an elevation marker in a room and then create an elevation off index 0 of the marker. I then get the existing cropbox and attempt to reduce the height by 3 feet (just as an example). The code runs successfully (within a transaction) but the result is as per the original cropbox, ie, no change. When an elevation marker is placed in a room using the User Interface Revit will automatically find the extents of the room and set the crop box accordingly. I'm wondering if this behavior is overwriting the changes I make via the API?
ElevationMarker elevMarker = ElevationMarker.CreateElevationMarker(doc, vft.Id, roomCenter, scale); ViewSection sv = elevMarker.CreateElevation(doc, viewPlan.Id, 0); doc.Regenerate(); // get the bounding box of the section BoundingBoxXYZ bb = sv.CropBox; // by way of example reduce the section height by 3 foot XYZ max = bb.Max; max = new XYZ(max.X, max.Y - 3, max.Z); bb.Max = max; // set the new bounding box sv.CropBox = bb;