return to main project

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have the following situation.
I am in a project and I create a new family. After I save the family and close it, I am back in my project file, BUT my ribbon is the ribbon of the family editor (with "create" and not "Architecture"as first panel). It looks like revit still thinks I am in the family.
My question is how can I save the family and return to my project with it's own ribbon ?
My code looks something like this :
Document ProjectDoc = commandData.Application.ActiveUIDocument.Document; //main project I start in
Document fdoc = commandData.Application.Application.NewFamilyDocument(templateFileName); //make new family
// make the most beautifull family you'd ever seen with sweeps, extrusions ect.
SaveAsOptions opt = new SaveAsOptions();
opt.OverwriteExistingFile = true;
fdoc.SaveAs(sfd.FileName, opt);
commandData.Application.OpenAndActivateDocument(ProjectDoc.PathName); //make project active again (If I check active document is project)
fdoc.Close();
My ribbon stays the one of the family editor, it even has the "Load family into project" button, which tells me "There are no other projects open to load this project into".
Does anybody know how to get my project ribbon back ? Or what I am doing wrong because apperently revit somehow is under the impression the family document (fdoc) is still opened ??