Message 1 of 2
Get/set Value for Type Parameters of System Families

Not applicable
09-03-2015
02:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello ,
I am attempting to create a command to set value to type parameter for some system families of some common architectural categories, but somehow this command only works well on wall category since the whole list of wall type is affected. Other categories such as floor, roof, ceiling, stair, etc. this command only effects to the first item in the type list
My main purpose is to be able to get a value from/set a value to type parameters of system families programmatically. And I am sure am going on a wrong way to achieve this.
Anyone can help me point out the problem or direct me to other better ways would be greatly appreciated
I am going on with this code:
public void SetParameter(Autodesk.Revit.DB.Document doc) { ElementCategoryFilter categoryFilter = new ElementCategoryFilter(BuiltInCategory.OST_Floors); FilteredElementCollector collector = new FilteredElementCollector(doc).WherePasses(categoryFilter); try { foreach (Element e in collector) { using (Transaction t = new Transaction(doc, "Set Parameter")) { t.Start(); e.get_Parameter(BuiltInParameter.ALL_MODEL_DESCRIPTION).Set("Something"); t.Commit(); } } TaskDialog.Show("Report", "Done"); } catch (Exception ex) { TaskDialog.Show("Error Information", ex.Message); } }