LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Setting the default for a parameter

    Employee
    Posted 06-15-2016 02:53

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: dglavastorm

    Hi - I may have completely missed something, but how do I declare a default for a parameter so that if the user does not select a radio button or enter a value, it uses the default instead.

    I'm using both Graph and composite node parameters.

    Thanks,

    Dave


  • 2.  RE: Setting the default for a parameter

    Employee
    Posted 06-16-2016 02:27

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: awilliams1024

    Hi Dave, see the example below (copy the code into the BRE canvas):

    node:Parameter_Test
    bretype:core::Composite
    editor:Label=Parameter Test
    editor:sortkey=57626c6808344129
    output:57626d2c1ce8653a/=
    outlink:0=/=Get_Property_Values.40fd2c7420761db6
    outputxy:0=390,80
    outputrotation:0=0
    prop:DefaultAction=Edit
    editor:XY=230,110
    editor:propdef=MyStringProperty|string|Input||None
    editor:propdef=MyBooleanProperty|boolean|Input||None
    node:Clock
    bretype:core::Static Data
    editor:Label=Clock
    editor:sortkey=57626ce83d740c4c
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    Clock:int
    1
    EOX
    editor:XY=160,80
    end:Clock
    
    node:Get_Property_Values
    bretype:core::Filter
    editor:Label=Get Property Values
    editor:sortkey=57626d1d08f06835
    input:@40fd2c74167f1ca2/=Clock.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    ## Get the string property value
    StrProperty = "{{^MyStringProperty=DefaultStringValue^}}"
    
    # If the property is to be unicode then prefix the quoted value with an 'u'  - e.g. 
    # u"This would be a Unicode data type string"
    
    # If you need to allow the user to insert a raw string that should not be interpreted, i.e. because
    # the string contains backslash characters that are not be interpreted such as a 
    # Windows file path e.g. c:\users\jdoe\temp
    # then prefix the quoted value with an 'r' - e.g.
    # r"c:\users\jdoe\temp"
    
    # For more details see the 'String and Unicode Literals' information in the 
    # 'General Language Section' of the BRAINScript help
    
    ## Get the boolean property value
    BoolProperty = {{^MyBooleanProperty=true^}}
    
    emit StrProperty, BoolProperty
    
    EOX
    editor:XY=280,80
    end:Get_Property_Values
    
    end:Parameter_Test
    Regards,
    Adrian