- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings to everybody,
I have a problem with the crop shape, I wish to create floorplans and set the crop shape as this sample:
but eventually Revit throws an exception that says that I can not associate non-rectangular shapes with the view.
Is it for real, I'm not be able to set those shapes through the API ? or is it that anything is wrong with my code:
//method 2: get the room solid and use the bottom face boundary
SpatialElementGeometryCalculator cal = new SpatialElementGeometryCalculator(doc,sebOp);
SpatialElementGeometryResults results = cal.CalculateSpatialElementGeometry(room);
Solid roomSolid2 = results.GetGeometry();
foreach (Face face in roomSolid2.Faces) {
PlanarFace plFace = face as PlanarFace;
if (plFace != null) {
XYZ normalFace = plFace.FaceNormal;
if (normalFace.Z == -1) {
roomBoundary = plFace.GetEdgesAsCurveLoops()[0];
break;
}
}
}
//set the crop layout
ViewCropRegionShapeManager cropManager = vplan.GetCropRegionShapeManager();
if (roomBoundary != null) {
cropManager.SetCropShape(roomBoundary);
}
best regards,
Miguel G.
Solved! Go to Solution.