i have a question about this error. im trying to set a value for a global parameter can someone help me solve this?
Hi Giel, welcome to the forum
GlobalParameters have to have the same type of value when setting, e.g. string for string, integer for integer, double for double. Try using an Integer node for the value you are trying to set
I just tested it with the Integer Slider. The error is now resolved, but it still doesn’t affect my global parameter in my Revit file.
Giel,
If you change the integer slider to a number slider, everything works fine.
I believe the issue lies with the integer at the moment. As @Mike.Buttery describes, ‘string for string, integer for integer, double for double’."
Thank you for the example; it’s now functioning. Another question I have is, can I set values for various Global parameters, or do I need to create a new globalparameter.setValue
for each parameter?
Look into list lacing and levels: https://www.youtube.com/watch?v=ZpOA_i9dkz4&list=PLdlF7MirPEC2yNFTGymESd3t7Xosfk9c2&index=48
To help you a little bit, I have, for example, two global parameters in my script for the x and y grids. With the use of lacing (longsets), I can keep my script short and write the values i want.
20230307_WriteGlobalParameter.dyn (13.7 KB)