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

pbloudoff
Explorer
Explorer

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

pbloudoff
Explorer
Explorer

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

 

0 Likes
Reply
294 Views
4 Replies
Replies (4)

jeremy_tammik
Autodesk
Autodesk

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
0 Likes

GaryOrrMBI
Collaborator
Collaborator
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)
0 Likes

sragan
Collaborator
Collaborator

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.

 

 

0 Likes

GaryOrrMBI
Collaborator
Collaborator

@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)