Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Viewport fails split operation and does not report error. however creates views on sheets has an unhandled exception.

2 REPLIES 2
Reply
Message 1 of 3
FrankHolidaytoiling
181 Views, 2 Replies

Viewport fails split operation and does not report error. however creates views on sheets has an unhandled exception.

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();
}

2 REPLIES 2
Message 2 of 3

Hi @FrankHolidaytoiling,

 

I can see a similar question on the link below which tries to give a little bit of information of splitting a ViewPort.

https://forums.autodesk.com/t5/revit-api-forum/split-crop-already-with-splits-doesn-t-seem-to-work/t... 

 

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 

 

 

  Moturi George,     Developer Advocacy and Support,  ADN Open
Message 3 of 3

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.

Post to forums  

Rail Community


Autodesk Design & Make Report