Message 1 of 7
Issues with Viewport.CanAddViewToSheet method

Not applicable
04-29-2019
01:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear All,
Despite the fact, all the conditions for view placement on sheet are met, Viewport.CanAddViewToSheet method constantly returns false value;
bool result = Viewport.CanAddViewToSheet(view.Document, view.Id, sheet.Id);
However, if I try to place the view on the sheet without checking whether the view CanAddViewToSheet, everything works fine. I provide the same input arguments in both cases.
Viewport.Create(view.Document, sheet.Id, view.Id, new XYZ(0, 0, 0));
I have seen, that a year ago @Anonymous asked the same question in the post:
https://forums.autodesk.com/t5/revit-api-forum/how-to-add-views-on-a-sheet/td-p/7935024
and was not answered. Does anyone experienced similar issues with this method?
Edit: I use views of ViewPlan class