Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modify properties in Columns

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
519 Views, 4 Replies

Modify properties in Columns

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:

 

modify_parameters.jpg

 

Thanks for your help.

 

David

4 REPLIES 4
Message 2 of 5
jeremytammik
in reply to: Anonymous

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-author.html#2

 

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/cloud-accelerator-and-more-revit-stuff.html#3

 

I promise you that working through that material will make the answer to your question completely obvious.

 

Have fun!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 5
Anonymous
in reply to: jeremytammik

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

Message 4 of 5
Anonymous
in reply to: Anonymous

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

        }

}

Message 5 of 5
Anonymous
in reply to: Anonymous

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.

 

parameter_shared.png

 

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.

Post to forums  

Forma Design Contest


Rail Community