Parameter.SuggestedMin operator

Introduced

v3.0

Description

Returns the suggested minimum value (Variant) for the parameter. A parameter can have two separate ranges: the Min/Max which defines the entire range of legal values; and the Suggested Minimum/Suggested Maximum which defines a sub-range of the Min/Max that make the most sense.

For example, an enormous number of subdivisions may theoretically be possible on a geometry, but for performance reasons a smaller range can be suggested to the user. The Suggested Min/Max values are used when determining the slider ranges for controls when parameters are inspected.

This property is only valid for numeric parameters. Other variant types, for example siString (see siVariantType) do not have the concept of Minimum or Maximum.

C# Syntax

// get accessor

Object rtn = Parameter.SuggestedMin;

Examples

VBScript Example

'

'	This example demonstrates how the Suggested Min and Max of a parameter can 

'	be useful for animating a parameter.

'

NewScene , false

' Set up a custom property set with some numeric values

set oRoot = Application.ActiveProject.ActiveScene.Root

set oPropSet = oRoot.AddProperty("Custom_parameter_list",,"TestRanges")				

oPropSet.AddParameter "Var1", siDouble,,siPersistable OR siAnimatable

oPropSet.AddParameter "Var2", siUByte,,siPersistable OR siAnimatable

oPropSet.AddParameter "Var3", siInt4,,siPersistable OR siAnimatable

oPropSet.AddParameter "Comment", siString 

' Animate all the parameters

for each oProp in oPropSet.Parameters

	AnimateOverSuggestedRange oProp 

next

InspectObj oPropSet

' This routine animates a parameter between suggested Min and suggested Max between the

' Frames 1 and 100

sub AnimateOverSuggestedRange( in_Parameter )

	' We only try to animate numeric parameters	

	if ( in_Parameter.ValueType = siInt4 OR _

	in_Parameter.ValueType = siDouble OR _

	in_Parameter.ValueType = siUByte OR _

	in_Parameter.ValueType = siFloat ) then

		SetKey in_Parameter.FullName, 1, in_Parameter.SuggestedMin

		SetKey in_Parameter.FullName, 100, in_Parameter.SuggestedMax

	end if

end sub

' Expected results:

'SetKey "TestRanges.Var1", 1, 0.5

'SetKey "TestRanges.Var1", 100, 0.6

'SetKey "TestRanges.Var2", 1, 10

'SetKey "TestRanges.Var2", 100, 30

'SetKey "TestRanges.Var3", 1, -100

'SetKey "TestRanges.Var3", 100, 9999

See Also

Parameter.SuggestedMax Parameter.Min Parameter.Max CustomProperty.AddParameter siVariantType