Family Loading Failed in Revit API 2012
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone,
I have created an extrusion in a family document and want to load it back to the Revit active project document. Everything works fine using Revit API 2011, however, when i try to implement the same thing using Revit 2012, it throws me an exception "A serious problem occurred. Please save and continue." When i debugged in, i receive an exception called "Family Loading Failed".
But everything work fine when i debugged using Revit 2011.
Below is some code snippets
public bool CreateFamily(Document familyDoc, ExternalCommandData commandData, Document projectDoc)
{
Transaction trans = new Transaction(familyDoc, "Create Family");
try
{
if (trans.Start() == TransactionStatus.Started)
{
.............(Add reference plane)
.............(Add alignment)
.............(Add dimension)
familyDoc.LoadFamily(projectDoc, new FamilyOption());
trans.Commit();
return true;
}
}
catch (Exception ex)
{
trans.RollBack();
return false;
}
}
Any idea why this code works only for Revit 2011, but not 2012?
Many thanks if someone can help.
http://www.box.net/shared/fn9nekkodxzse15l2qzj
