Hi guys.
Thanks for the thoughts!
You can create a project parameter that is a shared parameter with the API. Yes, the teminology is weird to some people, so I'll describe things as they appear in the GUI.
If in the GUI you go to Manage Parameters for the project and create a new project-level parameter, which you will assign to one or more categories, you can select whether the new parameter is Project or Shared. It's my understanding that it's the Shared kind which is the only kind which can be created by the API anyway. We can do that, so no problems there.
We'd need to create it as an Instance parameter, so again no problems there with the API (as I recall).
When creating it with the GUI, it appears that for non-numeric-based parameter types, including Text parameters (which we need), you get the choice to either make it:
1) "Values are aligned per group type" -- meaning this Instance parameter doesn't act like an instance parameter when in multiple instances of a group. The parameter value is forced to be the same for all family instances created automatically when more group instances are created, and stays the same if one family instance within a group has the value changed. So in the first group instance, if on a family instance within the group (mouseover and tabbing into it), I set the text parameter value to "X" it gets changed to "X" on that same family's parameter in all other instances of that group.
EXCEPT for cases like Mark and (I believe) Room Number, which I've read online are hard-coded into Revit to always act like instance parameters, even when used within groups. Those can have different values in every group instance (imagine the group contains doors, which is our case). But if they're any other (or your own) instance parameters (shared or not) even if they were declared as instance parameters, they're forced to have the same value whenever you change the value on any one family within the group definition. (see first example, below)
So when "Values are aligned per group type" is selected, your instance parameter behaves essentially like a type parameter, with the group definition kind of being the type definition (try to wrap your head around that...). I believe it's value can vary within each group definition, but when multiple instances of a group definition are placed, it MUST have the same value at all times for all of those instances.
This is the default behavior, it appears to be the behavior required for numeric-based parameter types, and it's my understanding was the only behavior that was available before Revit 2014.
So in this case:
Group Instance 1 (of type "MyGroup")
Family 1 within the group
Instance Parameter 1 = "Value 1"
Group Instance 2 (of type "MyGroup")
Family 1 within the group
Instance Parameter 1 = "Value 1"
Group Instance 3 (of type "MyGroup")
Family 1 within the group
Instance Parameter 1 = "Value 1"
If I mouse over Family 1 in Group Instance 1, tab into it and change Instance Parameter 1 to have a new value of "Value 2" subesquently ALL 3 GROUPS automatically have "Value 2" on that same parameter within the same family within the group. This is true even if that parameter was defined as Instance.
2) It's my understanding that "Values can vary by group instance" was added for Revit 2014 to resolve problems supporting COBie standards. This makes parameters declared as Instance (at least when declared at the project-level and bound by category) actually act like instance parameters when multiple (err) instances of a group are created.
So with this value set as the Instance parameter is being created at the project-level (or changed later?), I can have 3 group instances, and a family within each instance can have different values for that parameter in each group instance:
Group Instance 1 (of type "MyGroup")
Family 1 within the group
Instance Parameter 1 = "Value 1"
Group Instance 2 (of type "MyGroup")
Family 1 within the group
Instance Parameter 1 = "Value 2"
Group Instance 3 (of type "MyGroup")
Family 1 within the group
Instance Parameter 1 = "Value 3"
This is the behaviour our add-in is required to have for our own Instance parameter. And it CAN be accomplished manually in the Revit GUI.
So here's the kicker: it is also my understanding (and recollection from trying this in the past with project-level parameters declared as shared) that shared parameters DO NOT have an InternalDefinition, they only have an ExternalDefinition, and if you look in the API the ExternalDefinition does not have the SetAllowVaryBetweenGroups method.
Since it's my understanding that we can only create project-level parameters that are Shared, I think I'm stuck.
I knew all of this before posting, including that InternalDefinitions have the SetAllowVaryBetweenGroups method, but really should have spelled out the situation in more detail, as I have just done. My apologies for that. It's easy to presume everyone has the same frame of reference that you do.
So in summary, this is my conundrum:
With only the API, how do I create a project-level Text parameter (shared or not, I think shared is desirable for our add-in), assigned to the Doors category, that is Instance which can have the SetAllowVaryBetweenGroups method be called, so I can get the behaviour demonstrated in the second example above to occur?
Or, really, any way that I can get the behaviour demonstrated in the second example above to occur. I'll take anything at this point.
I really need help getting this resolved.
Thank you so very much for your time and expertise.