
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am not sure if I should post this on this forum as it might more a C# specific problem.
I am Closing and re-opening a file in the same program and this causing revit to have an unrecoverable error.
Is there any way for me to wait a couple of seconds before reopening it?
I am trying to avoid using threads because its my achillees heal in programming. So if there is any other options or advice I would love to hear them.
If it helps I am using the building coder's program here as a basis
http://thebuildingcoder.typepad.com/blog/2012/12/closing-the-active-document.html
Instead i am opening the placeholder, closing the main project and then opening the main project and closing the placeholder
Thank you in advance,
Jack
UIApplication uiapp = commandData.Application; UIDocument uidoc = uiapp.ActiveUIDocument; Application app = uiapp.Application; Document doc = uidoc.Document; string filename = "_placeholder_.rvt"; string docPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); string myPath = Path.Combine(docPath, filename); string userPath = doc.PathName; m_CloseHelper = new UiCloseHelper(uiapp,myPath); m_CloseHelper.CloseAndSave(uidoc); TaskDialog.Show("next", "Now lets re-Open the file"); //********************crashes here***********************// m_CloseHelper = new UiCloseHelper(uiapp, userPath); m_CloseHelper.CloseAndSave(uidoc); return Result.Succeeded;
Solved! Go to Solution.