Announcement

Collapse
No announcement yet.

Function with certain library not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Function with certain library not working

    Dear All,

    I don't understand why below function not working with DSCore.List.MinimumItem keyword.

    Can anyone clarify?




    TQVM.
    Attached Files

    #2
    Hello mimi,

    It works in the following format:

    Attached Files
    Last edited by amoursol; August 4, 2017, 03:15 PM.

    Sol Amour

    Architectural Explorer, Digital warrior, Affectual adventurer and Curious Human Being
    Portfolio Website @ Cargo Collective

    Comment


      #3
      Thanks. It works, but i still don't understand the concept. What does the line of return = [Imperative] means? What is the difference with or without the line?

      Comment


        #4
        The default without that line uses Associative code: If a collection of elements is used as the input to a function which normally takes a single value, the function is called individually for each member of that collection.

        With the line it uses Imperative code: In Imperative, a programmer has the option to write code that manually iterates over the collection, extracting individual members one at a time.

        To quote the Designscript summary user manual:

        Imperative programming is characterized by explicit 'flow control' using for loops (for iteration) and if statements (for conditionals) as foundin familiar scripting and programming languages such as Python. Imperative programming is useful to perform iteration, either steppingthrough a collection or to perform some iterative feedback or optimisation loop.

        Associative programming uses the concept of graph dependencies to establish 'flow control’ and is useful for modeling complex operations(such as geometric processes) applied to collection of objects, in a very succinct programming style with automatic change propagation.

        The two styles of programming address different computational tasks and essentially complement each other. The different styles ofprogramming share a common notation which means that in some case the same code can be executed either associatively or imperatively. Inaddition there are certain computational tasks that benefit from a combination of programming styles within the same program or indeedwithin the same function or method. DesignScript supports this flexibility by allowing Imperative code to be nested within Associative codeand vice versa.
        Have a read of the following link: http://aucache.autodesk.com/au2012/s...ser_manual.pdf

        Sol Amour

        Architectural Explorer, Digital warrior, Affectual adventurer and Curious Human Being
        Portfolio Website @ Cargo Collective

        Comment

        Related Topics

        Collapse

        Working...
        X