I am attempting to split a viewport just after i close a transaction to place on a sheet and the creation of viewsheets fails, probably because this operation is failing. Do I need to run this as a post operation or a seperate addin? Can the operation of splitting an elevation be performed on views as well as viewports from a sheet?
using (Transaction t = new Transaction(doc, "split"))
{
t.Start();
foreach (ElementId elementId in viewSheet.GetAllViewports())
{
View viewport = doc.GetElement(elementId) as View;
ViewCropRegionShapeManager cropManager = viewport.GetCropRegionShapeManager();
if (!cropManager.CanBeSplit) throw new Exception("Cannot Split!");
cropManager.SplitRegionHorizontally(0, 0.4999, 0.5001);
}
t.Commit();
}
I can see a similar question on the link below which tries to give a little bit of information of splitting a ViewPort.
You can also view the links below that describes how you can split your Views.
https://forums.autodesk.com/t5/revit-api-forum/ability-to-set-split-region-offset/td-p/10042996
https://adndevblog.typepad.com/aec/2015/03/revitapi-how-to-resize-cropbox-of-view.html
Thanx,
I found the first or top hyperlink already. I was not having success with basic splitting of view cropbox within a modeless form addin, so i am going to attempt it as a seperate addin.
Can't find what you're looking for? Ask the community or share your knowledge.