I am trying to load the family from my location but I am getting the error of family cannot be loaded. It Loads the family for 1st time but when I delete the family and rerun I get below error can any help how to get rid of this. I need to Restart my Revit every time.
Wall wall = document.GetElement(uniqueIDstring) as Wall;
String fileName = @"C:\ProgramData\Autodesk\RVT 2018\Libraries\US Metric\Openings\M_Opening.rfa";
Family family = null;
if (!document.LoadFamily(fileName, out family))
{
throw new Exception("Unable to load " + fileName);
}
[Window Title]
Run Macro Failed
[Main Instruction]
Revit failed to execute OpeningProfile.
[Expanded Information]
A problem has been detected.
System.Exception: Unable to load C:\ProgramData\Autodesk\RVT 2018\Libraries\US Metric\Openings\M_Opening.rfa
at MacroModule.executeMacro_(MacroModule* , AString* macroName)
at MacroModule.executeMacro(MacroModule* , AString* )
at UIMacroGeneralManager.runMacro(UIMacroGeneralManager* , MacroModule* pModule, AString* macroName)
[^] Hide details [Close]
@kmkxperia hello, can you share your revit family so we can check takes. thanks
Observed issue
1st run the Family is loaded and now delete it and change the family name to other family say M_Openings.rfa and build project and run macro.
Program runs without error but no Openings are not visible but when you mouse hove over they are highlighted. Now again delete these by selecting and run the macro. now error is observed that it is not able to load the family and it pass null.
Code is straight forward, is some thing in code missing in code or using the incorrect method or steps
@kmkxperia hello, i have loaded your family no issues. I can't test/run because i don't your micro? Try to use door family instead of generic family and see if helps. i can't help much. thanks
Can't find what you're looking for? Ask the community or share your knowledge.