Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

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: 

Does "Add to all elements in the selected categories" have API documentation?

4 REPLIES 4
Reply
Message 1 of 5
pbloudoff
286 Views, 4 Replies

Does "Add to all elements in the selected categories" have API documentation?

Hello,

 

I've been working on a script that adds parameters to families listed in a schedule based on a user input of the column name in the schedule (the script is supposed to grab the parameter from the schedule and add it to the family). Then, I realized that the dozen or so hours I've spent pulling out my hair figuring it out could have been avoided, since there already exists something that does this in the UI. However, I'm a little stubborn and still want the script to be worthwhile, so is there any documentation for the following UI button? Thanks in advance!

 

pbloudoff_0-1728626313440.png

 

4 REPLIES 4
Message 2 of 5
jeremy_tammik
in reply to: pbloudoff

Yup, it often pays off to explore existing UI functionality before even thinking about addressing the task via API. Still, I asked the development team for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 5
GaryOrrMBI
in reply to: pbloudoff

It isn't straight forward unless you know what to look for but start by looking at the Binding Class:

Binding Class
Binding objects are used to take a parameter definition and bind it to one or more categories.

Remarks
This class is a base class for all types of parameter binding within Autodesk Revit. Once the binding objects are created and added to the document parameters will be added to elements in those categories specified in the binding. There are currently two types of binding available, Instance binding and Type binding. The key difference between the two is that the instance bound parameters appear on all instances of the elements in those categories. Changing the parameter on one does not affect the other instances of the parameter. The Type bound parameters appear only on the type object and is shared by all the instances that use that type. Changing the type bound parameter affects all instances of the elements that use that type. Note, a definition can only be bound to an instance or a type and not both.

-G
Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
Message 4 of 5
sragan
in reply to: pbloudoff

You (or maybe Revit) lost me.  How can you add a a parameter to a category, and not add it to all the elements in that category?

 

From the looks of your dialog box, it looks like you are trying to add a "project parameter".  But how did you get both "type" and "instance" unchecked at the same time?  Doesn't it have to be one or the other?

 

I can't seem to make any combination of selections that will allow me to uncheck the "Add to all elements in a selected category" box.   It remains checked and greyed out no matter what I do or select.

 

 

Message 5 of 5
GaryOrrMBI
in reply to: sragan

@sragan,

This can happen if you use the same shared parameter in two different families, as a Type in one of them and an Instance in the other, then import both families into the same project.

Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report