I’m trying to us Dynamo to add a few filters to new projects once worksets are enabled. I’ve been able to make a filter which grabs things that are on the workset containing the string “Demo”. See below
The filter for elements that need callout is more complicated because I don’t want to collect things in links so I have a workset rule and a shared parameter-project parameter rule. When I run this script I can’t create either rule. The second rule doesn’t even get started. Also note that the filter rules on this is set to “OR” when it should be “AND”. I don’t know how to set that.
I think it might be because I’m using Text Notes as my category for the “All Elements of Category” node. It works for the demo filter because everything has a workset and because this is a brand new project there is not another category that has any elements to use for Parameter.ParameterByName. The callout parameter is not assigned to text notes. Is there another way to get the parameter to use for the FilterRule.ByRuleType.
I’ve tried separating this into two node and changed how I was getting the parameter, but I’m running into new issues.
I’m not sure how to create a “Yes” value.
Secondly I’m still not sure how to create a parameter input without an element. I’ve tried with the Document.ProjectParameter node but it is giving me the wrong argument types.
The workset portion of the script is still not working. It doesn’t give any errors but it is not filling in the filter value which should be HVAC.
Can’t change whether the filter uses "and or “or.”
I can’t set the filters value for the Com_NeedsCallout Parameter to yes. It doesn’t accept a string or boolean. The FilterRule.ByRuleType node wants a different parameter variable that I don’t know how to get without elements.Revit Dev - Project Startup.dyn (280.5 KB)
I believe the parameter does need to come from an element. What you’re using is the project parameter definition so to speak. You need to supply the parameter element that is associated with the category that the project parameter was applied to.
If it’s a type parameter you can still get it from the FamilyType. If it’s an instance parameter it may be a little trickier. You can always place an instance, get the parameter, create the filter, then delete the instance if you have to.
Search “ParameterBindings” on the forum or in the Revit API to see the methods to get the id of shared parameters. I just showed how to do it with BuiltInParameter “Comments” because I knew that was common ground for everyone.
I looked into that a determined it’s way above my head. I decided to add a element that I’ll delete after I make the filter. I’ve been able to create the filter but it is still set to OR and I can’t seem to set the value to “Yes”.