I am hoping to get some help with setting a Yes/No global parameter. I have successfully modified text based global parameters in this script but the Yes/No is being a pain. Here is the method I am using right now.
I have looked around and have not found any info regarding whether I can or not. I can modify Global text parameters so it would be surprising if the Global Yes/No parameters were off limits.
Edit: I may just use a text parameters and then set the global yes/no parameters to work off of formulas based on the number parameter at this point. Still, I would like to know why this isn’t working.
Upon further testing it almost seems like the only Global Parameter that CAN be modified is a text parameter. I have tried length and number along with yes/no and none of them seem to work except text.
I am trying to utilize your script in lieu of the OOB global nodes since they do not seem to be working for anything except text parameters. When I paste your code I am only getting IN and not IN. Is the script out of date and could you possibly update it to work again? Thanks in advance if you can!
I was thinking about using Python, glad that someone already did it before.
Just change the code like this, and it should work, but only for one parameter at the time.
from Autodesk.Revit import DB as db
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
filter = db.FilteredElementCollector(doc).OfClass(db.GlobalParameter)
gp = UnwrapElement(IN)
#getting the right ParameterValue constructor :
methodname = gp.GetValue().GetType().ToString().rsplit('.',1)[-1]
#setting the parameter with the right parametervalue constructor
out = 'success'
out = 'failed, check if the parameter value is the right type'
OUT = out