How to go through a document's project parameters and shared parameters

How to go through a document's project parameters and shared parameters

Anonymous
Not applicable
1,951 Views
1 Reply
Message 1 of 2

How to go through a document's project parameters and shared parameters

Anonymous
Not applicable

Hi,

 

I'm trying to go through a Revit Document and see if there are any Project Parameters with the name of "Test Name" and see if those parameters are bound to the OST_Furniture category. How would I iterate through this? I tried using 

 

//get the binding map of current document

BindingMap bindingMap = doc.ParameterBindings;

 

foreach (InstanceBinding instanceBinding in bindingMap)

            {

                MessageBox.Show(instanceBinding.ToString() + "\n");

                

            }

 

I can get the categories but I cannot access the parameter name through here. I saw a post by our best friend Mr. Tammik. I also looked at the "BrowseBindings" SDK but I was confused it was in visual basic not C#. Even so, I don't know how to  get a list of all parameters in a document and see what category they are bound to.

 

http://thebuildingcoder.typepad.com/blog/2010/01/retrieving-project-parameters.html

 

Thank you.

 

 

 

 

0 Likes
Accepted solutions (1)
1,952 Views
1 Reply
Reply (1)
Message 2 of 2

bxw
Enthusiast
Enthusiast
Accepted solution

You can get the parameter names like this:

 

BindingMap bm = doc.ParameterBindings;

DefinitionBindingMapIterator itor = bm.ForwardIterator();

itor.Reset();

while (itor.MoveNext())

{

Definition d = itor.Key; 

MessageBox.Show(d.Name.ToString() + "\n");

}

 

 

there may be another way but this works.