Advanced - Custom Parameters

You may want to add parameters to your paintbar that can be set by the paintbar's user. This can be done in the following manner:


Define the Parameter in Code


Do that by calling the following procedure anywhere in the paintbar code. NOTE: all parameters must be literals, not variables, otherwise the parsing of paintbars will not pick this up.


        public void DefinePaintbarParameter(String ParameterID, string ParameterDescription, Boolean IsInteger, Double Minimum, Double Maximum, Double Increment = 1, Double Default = 0)




a String identifier for the parameter that you can use in further code to get its value that was set by the user


a String description for the parameter that will be shown to the user in the paintbar parameter editor


pass true if the parameter should be an integer, false otherwise


Double - the minimum value for the parameter


Double - the maximum value for the parameter


Double - the increment for the up/down arrows on the parameter selector


Double - the default value for the parameter


Use the Parameter


To get the parameter's value in code, call this function, passing it the ParameterID. It will return the Double value of the parameter.


 public Double GetPaintbarParameter(String ParameterID)