
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm currently trying to write a translation tool for Revit Families. The user has the possibility to load *.rfa files into my plugin and translate its types and parameters by a CSV file. The same process will be applied for its nested families automatically. Now all changes made during the process should be temporary until the user decides to save the modified families. But if I reload the families without saving them, the changes made to the nested families are still there. Is this an expected behavior of Revit? If yes, is there a possibilty to load a nested family with temporary changes, or do I have to save a nested family in a temporary directory to load the family in this way back to its parent?
As soon as a nested family is translated I load the family back to it's parent by calling:
Family nestedFamily;
Family parentFamily;
nestedFamily.Document.LoadFamily(parentFamily, new FamilyLoadOptions());
This is my implementation of IFamilyLoadOptions:
public class FamilyLoadOptions : IFamilyLoadOptions
{
public bool OnFamilyFound(bool familyInUse, out bool overwriteParameterValues)
{
overwriteParameterValues = false;
return true;
}
public bool OnSharedFamilyFound(Family sharedFamily, bool familyInUse, out FamilySource source, out bool overwriteParameterValues)
{
overwriteParameterValues = false;
source = FamilySource.Family;
return true;
}
}
Thanks!
Solved! Go to Solution.