
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
TL;DR
Is there a way of deleting a specific PrintSetup and ViewSheetSetting programatically if i know its name?
Long version:
I'm writing a function that can print a large set of sheets in various paper sizes to separate/combined PDFs. To be able to apply the PrintSetup, it needs to be set in an "in-session" state and saved using SaveAs() (to my knowledge). But after saving an "in-session"-PrintSetup to a new PrintSetup, I cannot find a way of deleting said new PrintSetup. After the PrintManager has printed the sheets, I'm stuck with lots of temporary PrintSetups. The same goes for ViewSheetSettings.
try { pMgr.PrintSetup.Delete(); pMgr.ViewSheetSetting.Delete(); } catch (Exception ex) { //Shows 'The <in-session> print setup cannot be deleted' TaskDialog.Show("REVIT", ex.Message); }
So the problem is: I'm not able to apply the PrintSetup and ViewSheetSettings unless i'm using them "in-session" and saving them using SaveAs, and i'm not able to delete the PrintSetup and ViewSheetSettings afterwards.
Has anyone experiences similar issues, or found a way to solve it?
Cheers,
Eirik Aasved Holst
Solved! Go to Solution.