I am trying getting the "Columns" of model with a method that receive a Category how parameter. Then, with a "for" modify the value in two properties of all Columns.
See code:
public void GenerateFormworkToElements(string category) { SubTransaction createFormwork = new SubTransaction(m_revit.ActiveUIDocument.Document); try { createFormwork.Start();
//Parameter is a Category if (category == "Structural Columns") { //Here to find the columns y modify the properties } createFormwork.Commit(); } catch (Exception ex) { TaskDialog.Show("GenerateFormworkToElements", "Error = " + ex.Message); createFormwork.RollBack(); } }
The following are properties to change:
Thanks for your help.
David
Dear David,
If you are new to the Revit API, the first thing to do is to work through the getting started material, especially the 'My First Revit Plug-in' and DevTV tutorials:
http://thebuildingcoder.typepad.com/blog/about-the
Getting started includes installing the SDK and RevitLookup, a very important Revit project database exploration tool.
Here are some recent other notes on getting started:
http://thebuildingcoder.typepad.com/blog/2015/01/c
I promise you that working through that material will make the answer to your question completely obvious.
Have fun!
Best regards,
Jeremy
Hi Jeremy:
I am relatively new, but I won experience doing my first Add-in.
My question is specifically el code that get the all columns of a model according to parameter "Category" (see code up). If you may help me It would be great.
I will revise the information that you've shared.
Thanks very much.
Regards
David
Hi,
Here goes the code:
FilteredElementCollector collector
= new FilteredElementCollector(doc)
.OfClass(typeof(FamilyInstance));
foreach (FamilyInstance fi in collector)
{
if (fi.StructuralType == StructuralType.Column)
{
do you work here
}
}
Hi,
Thanks very much for responding. The code works good.
How can getting of a Element the value the properties and shared parameters?. See image.
I am using the code following, but not woks:
foreach (FamilyInstance fi in collector) { if (fi.StructuralType == StructuralType.Column) { //Get parameter "GyM Categoría" Parameter gymCategoria = fi.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS); gymCategoria = fi.LookupParameter("Categoria GyM"); } }
Thanks for you help.
Can't find what you're looking for? Ask the community or share your knowledge.