Again, I'm a noob.
Our project has a shared parameter "Ceres ID Tag" defined for a certain FamilyType of doors.
I am filtering on OST_Doors, converting it ToElements().
I am iterating through the collection and trying to evaluate the value of the Ceres ID Tag (value=10) for the particular door that I am interested in.
When I iterate through the parameters collection for the particular door that does have a Ceres ID Tag assigned to the shared parameter, I do not see Ceres ID Tag in the parameters.
I have been unable to find any code demonstrating how to do this.
Code follows:
private string ListElements(ExternalCommandData commandData)
{
UIDocument uiDoc = commandData.Application.ActiveUIDocument;
Document document = uiDoc.Document;
// Create a Filter to get all the doors in the document
ElementClassFilter familyInstanceFilter = new ElementClassFilter(typeof(FamilyInstance));
ElementCategoryFilter doorsCategoryfilter =
new ElementCategoryFilter(BuiltInCategory.OST_Doors);
LogicalAndFilter doorInstancesFilter =
new LogicalAndFilter(familyInstanceFilter, doorsCategoryfilter);
FilteredElementCollector collector = new FilteredElementCollector(document);
ICollection<Element> doors = collector.WherePasses(doorInstancesFilter).ToEleme nts();
String prompt = "The ids of the doors in the current document are:";
foreach (Element door in doors)
{
prompt += "\n\t" + door.Id.IntegerValue + ": " + door.Name;
if (door.Id.IntegerValue == 196468)
{
foreach (Parameter parm in door.Parameters)
{
prompt += "\n " + parm.Definition.Name + ":" + parm.AsValueString();
}
}
}
return prompt;
}
Our project has a shared parameter "Ceres ID Tag" defined for a certain FamilyType of doors.
I am filtering on OST_Doors, converting it ToElements().
I am iterating through the collection and trying to evaluate the value of the Ceres ID Tag (value=10) for the particular door that I am interested in.
When I iterate through the parameters collection for the particular door that does have a Ceres ID Tag assigned to the shared parameter, I do not see Ceres ID Tag in the parameters.
I have been unable to find any code demonstrating how to do this.
Code follows:
private string ListElements(ExternalCommandData commandData)
{
UIDocument uiDoc = commandData.Application.ActiveUIDocument;
Document document = uiDoc.Document;
// Create a Filter to get all the doors in the document
ElementClassFilter familyInstanceFilter = new ElementClassFilter(typeof(FamilyInstance));
ElementCategoryFilter doorsCategoryfilter =
new ElementCategoryFilter(BuiltInCategory.OST_Doors);
LogicalAndFilter doorInstancesFilter =
new LogicalAndFilter(familyInstanceFilter, doorsCategoryfilter);
FilteredElementCollector collector = new FilteredElementCollector(document);
ICollection<Element> doors = collector.WherePasses(doorInstancesFilter).ToEleme nts();
String prompt = "The ids of the doors in the current document are:";
foreach (Element door in doors)
{
prompt += "\n\t" + door.Id.IntegerValue + ": " + door.Name;
if (door.Id.IntegerValue == 196468)
{
foreach (Parameter parm in door.Parameters)
{
prompt += "\n " + parm.Definition.Name + ":" + parm.AsValueString();
}
}
}
return prompt;
}
Comment