Hi All
I want to create a shared parameter with the data type Yes/No; the parameter value should be set to “No” when the shared Parameter is created.
Please look at the snapshot below and attach the Dynamo script to see what is going wrong. The Parameter gets created successfully, but its value is set to “Yes.”
Create & Set shared parameter.dyn (24.0 KB)
Help me to resolve this issue
Thanks in advance
You are creating the shared parameter. But not setting the value. You’ll need to set it after it is created. And as you’ve seen, when you create a shared parameter in a family for the first time - the value is automatically set to yes. This happens even if you create the parameter manually. So you’ll need to get the parameter after it is created and change the value. If the family has multiple types, you’ll need to check and set each one.
Hi @aaron_rumple
Thanks for your response. I have created another script to set the Yes/No data type shared parameter value to “No”, but it is not working as expected.
Please help me resolve this issue; I have attached the script and screenshot.
Set Shared Parameter_Value.dyn (20.1 KB)
You haven’t set the family type name. If there are no defined types, Revit will use the family name as the type - only when loaded into a project. Until then, there are no types unless you make a type. Good practice is to always make at least one type, such as “Default” or some other useful identifier. Then you can feed that type to the FamilyDocument.SetParameterVValueByName node. Without that - it doesn’t work.
That’s issue one.
Second.
The yes/no parameter type is stored as an integer. Not a bool. (What’s the diff, eh? Computers.) So, give it a 0 or 1.
1 Like
Thanks @aaron_rumple I will take a look