Hi everybody!
I understand from some of the threads here that using FiteredElementCollector with "TYPEOF(FAMILYINSTANCE)" will
collect instance parameters of family ONLY if they are present in the model.
I need to collect these properties for Families that are present in Project but I haven't used them in the model.
this code(part of a method that receives a Family f) returns nothing because there are no instances of family in the model yet:
ElementClassFilter instancecollector = new ElementClassFilter(typeof(FamilyInstance));
FilteredElementCollector familyinstance = new FilteredElementCollector(doc);
List<FamilyInstance> finstance = familyinstance.WherePasses(instancecollector)
.Cast<FamilyInstance>()
.Where(x => x.Symbol.Family.Name.Equals(f.Name))
.ToList();
This is part of a cleanup I am doing on office's families.
How can I achieve this?
Hi everybody!
I understand from some of the threads here that using FiteredElementCollector with "TYPEOF(FAMILYINSTANCE)" will
collect instance parameters of family ONLY if they are present in the model.
I need to collect these properties for Families that are present in Project but I haven't used them in the model.
this code(part of a method that receives a Family f) returns nothing because there are no instances of family in the model yet:
ElementClassFilter instancecollector = new ElementClassFilter(typeof(FamilyInstance));
FilteredElementCollector familyinstance = new FilteredElementCollector(doc);
List<FamilyInstance> finstance = familyinstance.WherePasses(instancecollector)
.Cast<FamilyInstance>()
.Where(x => x.Symbol.Family.Name.Equals(f.Name))
.ToList();
This is part of a cleanup I am doing on office's families.
How can I achieve this?
Hi there,
Actually this is correct. FamilyInstance means there is an INSTANCE of family in the project. If you have specified FamilyType of FamilySymbol loaded in the project, you will not get collection of FamilyInstances, until you please at least one of the project.
Hope that helps,
Luki
Hi there,
Actually this is correct. FamilyInstance means there is an INSTANCE of family in the project. If you have specified FamilyType of FamilySymbol loaded in the project, you will not get collection of FamilyInstances, until you please at least one of the project.
Hope that helps,
Luki
Thanks for reply.
I'm wondering how I can collect all those parameters.
I can see all of them in 'Revit Lookup' under FamilyInstance and I am not using those families in the model.
How can Revit lookup collect them since it's an Add-in as well?
Is there another way?
Thanks for reply.
I'm wondering how I can collect all those parameters.
I can see all of them in 'Revit Lookup' under FamilyInstance and I am not using those families in the model.
How can Revit lookup collect them since it's an Add-in as well?
Is there another way?
I think instance parameters are accessible only for the elements that are placed inside the project.
You Can't access the instance parameters before placing the element.
I think instance parameters are accessible only for the elements that are placed inside the project.
You Can't access the instance parameters before placing the element.
This will help you to collect instance parameter.You have to open Editfamily to access the instance parameter.
FamilyParameterSet instanceParameter = new FamilyParameterSet();
FilteredElementCollector coll = new FilteredElementCollector(doc).OfClass(typeof(FamilySymbol)).WhereElementIsElementType();
foreach(Element e in coll)
{
FamilySymbol FS = e as FamilySymbol;
if(FS.Name.Contains("Your Family Symbol Name"))
{
Family f = FS.Family;
Document famdoc=doc.EditFamily(f);
if(famdoc!=null)
{
FamilyManager FM = famdoc.FamilyManager;
if(FM!=null)
{
foreach(FamilyParameter fp in FM.Parameters)
{
if(fp.IsInstance)
{
string parameterName = fp.Definition.Name;
instanceParameter.Insert(fp);
}
}
}
}
}
}
This will help you to collect instance parameter.You have to open Editfamily to access the instance parameter.
FamilyParameterSet instanceParameter = new FamilyParameterSet();
FilteredElementCollector coll = new FilteredElementCollector(doc).OfClass(typeof(FamilySymbol)).WhereElementIsElementType();
foreach(Element e in coll)
{
FamilySymbol FS = e as FamilySymbol;
if(FS.Name.Contains("Your Family Symbol Name"))
{
Family f = FS.Family;
Document famdoc=doc.EditFamily(f);
if(famdoc!=null)
{
FamilyManager FM = famdoc.FamilyManager;
if(FM!=null)
{
foreach(FamilyParameter fp in FM.Parameters)
{
if(fp.IsInstance)
{
string parameterName = fp.Definition.Name;
instanceParameter.Insert(fp);
}
}
}
}
}
}
Thanks for reply @naveen.kumar.t
I haven't tried the code yet. But opening families one by one is my last resort. there are more than 100 of them.
then I have to reinsert them in the project after cleaning up parameters.
my question is how come Revit Lookup can collect all these parameters?
Thanks for reply @naveen.kumar.t
I haven't tried the code yet. But opening families one by one is my last resort. there are more than 100 of them.
then I have to reinsert them in the project after cleaning up parameters.
my question is how come Revit Lookup can collect all these parameters?
Could you provide a little more information on what you are wanting to do with the Parameters / Families / Instances once you have them? You mention cleaning them up, but is that values only, or editing / removing the actual parameters? If it is the later, the only way to do that is in the Family editor so you would be needing to do that anyway. I think a little more information could help us get you to a solution.
Could you provide a little more information on what you are wanting to do with the Parameters / Families / Instances once you have them? You mention cleaning them up, but is that values only, or editing / removing the actual parameters? If it is the later, the only way to do that is in the Family editor so you would be needing to do that anyway. I think a little more information could help us get you to a solution.
Hi @Sean_Page
I am trying to collect all shared parameters under each family.
Somebody at our office had the bright idea that shared parameters need to be updated/recreated when going from revit 2018 to 2019.
So now, I have duplicates of shared parameters which have same name but not same GUID.
All these scattered in some families.
more than that, some of them are assigned to 'Type' and others to 'Instance' in the family.
I need to collect all shared parameters and hopefully automatically remove odd ones.
In a word, for now I just need to have a clear picture of all shared parameters in families.
Hi @Sean_Page
I am trying to collect all shared parameters under each family.
Somebody at our office had the bright idea that shared parameters need to be updated/recreated when going from revit 2018 to 2019.
So now, I have duplicates of shared parameters which have same name but not same GUID.
All these scattered in some families.
more than that, some of them are assigned to 'Type' and others to 'Instance' in the family.
I need to collect all shared parameters and hopefully automatically remove odd ones.
In a word, for now I just need to have a clear picture of all shared parameters in families.
Can't find what you're looking for? Ask the community or share your knowledge.