https://thebuildingcoder.typepad.com/blog/2011/06/reloading-a-family.html
This is the article I post I was reading. Apologize for looking like a lost cause. It was late at night and I pasted the wrong code in my previous post... But my question still remains the same.
It seems I implemented a family option class way I am supposed to but the error says I did not - and gives me the same required implementation variables
'MW_Module.FamilyOption' does not implement interface member 'Autodesk.Revit.DB.IFamilyLoadOptions.OnSharedFamilyFound(Autodesk.Revit.DB.Family, bool, out Autodesk.Revit.DB.FamilySource, out bool)' (CS0535) it\Macros\2023\Revit\AppHookup\MW_Module\Source\MW_Module\ThisApplication.cs:25,8
'MW_Module.FamilyOption' does not implement interface member 'Autodesk.Revit.DB.IFamilyLoadOptions.OnFamilyFound(bool, out bool)' (CS0535) -
using System;
using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Reflection;
using System.ComponentModel;
using System.Collections;
using System.Windows;
using System.IO;
namespace MW_Module
{
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
[Autodesk.Revit.DB.Macros.AddInId("B3515362-619A-49B7-AC79-3428485161C5")]
class FamilyOption : IFamilyLoadOptions
{
public bool OnFamilyFound(
bool familyInUse,
ref bool overwriteParameterValues )
{
overwriteParameterValues = true;
return true;
}
public bool OnSharedFamilyFound(
Family sharedFamily,
bool familyInUse,
ref FamilySource source,
ref bool overwriteParameterValues )
{
return true;
}
}
public partial class ThisApplication
{
private void Module_Startup(object sender, EventArgs e)
{
}
private void Module_Shutdown(object sender, EventArgs e)
{
}
#region Revit Macros generated code
private void InternalStartup()
{
this.Startup += new System.EventHandler(Module_Startup);
this.Shutdown += new System.EventHandler(Module_Shutdown);
}
#endregion
public void Hello_World()
{
TaskDialog.Show("Hello","World");
}
public void Repath_All_Fam()
{
Document doc = this.ActiveUIDocument.Document;
UIApplication uiapp = new UIApplication(doc.Application);
FilteredElementCollector collector = new FilteredElementCollector(doc);
ICollection<Element> elements = collector.OfClass(typeof(Family)).ToElements();
StringBuilder sb = new StringBuilder();
foreach (Element el in elements)
{
Family f = el as Family;
sb.AppendLine(f.Name.ToString());
//Document famDoc = doc.EditFamily(f);
//sb.AppendLine(f.Name.ToString() + "\n" + famDoc.PathName);
//famDoc.Close();
}
TaskDialog.Show("Family Names", sb.ToString());
}
}
}
The definition of insanity is doing the same thing over and over again and expecting different results