Wednesday 7 December 2016

List.Map

__Map(func,List0)

List.LaceShortest

__LaceShortest(comb,{List1,List2})

List.LaceLongest

__LaceLongest(comb,{List1,List2})

List.Filter

__Filter(List0,condition)

In this way you will have a list with two sublists. If you want two separated lists you need to extract the first sublist using code ListF[0] and ListF[1] for the second. But it will doesn't work. You need a little trick. Create a list of a given list, then return a flatten list with one less sublist: List.Flatten({List0},1).
Now you can split in two lists.

List.Combine

__Combine(comb,{List1,List2})

List.CartesianProduct

__CartesianProduct(comb,{List1,List2})

Tuesday 6 December 2016

List.LastItem

List.LastItem(List0)
List.LastItem({1,2,3,4})

List.Join

List.Join({List0,List1})

List.IsEmpty

List.IsEmpty(List0)
List.IsEmpty({})

List.GroupByKey

List.GroupByKey(List0,keys)

In this way you will have a list with two sublists. If you want two separated lists you need to extract the first sublist using code ListGBK[0] and ListGBK[1] for the second. But it will doesn't work. You need a little trick. Create a list of a given list, then return a flatten list with one less sublist: List.Flatten({List0},1).
Now you can split in two lists.

List.GetItemAtIndex

List.GetItemAtIndex(List0,index)
List0[index]
List.GetItemAtIndex({1,2,3,4},1)

List.Flatten

List.Flatten(List0,amt)
List.Flatten({1,2,{3,{4}},5},1)

List.FirstItem

List.FirstItem(List0)
List0[0]
List.FirstItem({1,2,3,4})

Monday 5 December 2016

List.FirstIndexOf

List.FirstIndexOf(List0,item)
List.FirstIndexOf({1,2,3,4},3)

List.FilterByBoolMask

List.FilterByBoolMask(List0,mask)
List.FilterByBoolMask({1,2,3,4},{true,false,false,true})

In this way you will have a list with two sublists. Separate sublists will doesn't work with classic code. You need a little trick. Create a list of a given list, then return a flatten list with one less sublist.
ListFBBM = List.Flatten({List0},1);
ListFBBM_in = ListFBBM[0];
ListFBBM_out = ListFBBM[1];

Or use the following method:
ListFBBM_in = __TryGetValueFromNestedDictionaries(ListFBBM, "in");
ListFBBM_out = __TryGetValueFromNestedDictionaries(ListFBBM, "out");

List.DropItems

List.DropItems(List0,amount)
List.DropItems({1,2,3,4},2)

List.DropEveryNthItem

List.DropEveryNthItem(List0,n,offset)
List.DropEveryNthItem({1,2,3,4},2,1)

List.DiagonalRight

List.DiagonalRight(List0,subLength)
List.DiagonalRight({1,2,3,4},3)

List.DiagonalLeft

List.DiagonalLeft(List0,rowLength)
List.DiagonalLeft({1,2,3,4},3)

List.Deconstruct

List.Deconstruct(List0)
List.Deconstruct({1,2,3,4})

In this way you will have a list with two sublists. If you want two separated lists you need to extract the first sublist using code ListD[0] and ListD[1] for the second. But it will doesn't work. You need a little trick. Create a list of a given list, then return a flatten list with one less sublist: List.Flatten({List0},1).
Now you can split in two lists.

List.Cycle

List.Cycle(List0,amount)
List.Cycle({1,2,3,4},3)

Friday 2 December 2016

List.Count

List.Count(List0)
List.Count({1,2,3,4})

List.ContainsItem

List.ContainsItem(List0,item)
List.ContainsItem({1,2,3,4},{5,1})

List.Combinations

List.Combinations(List0,length,replace)
List.Combinations({1,2,3,4},2,false)

List.Clean

List.Clean(List0,preInd)
List.Clean({1,2,null,4},false)

List.Chop

List.Chop(List0,lengths)
List.Chop({"a","b","c","d","e"},{2,1,1,5})

List.AllIndicesOf

List.AllIndicesOf(List0,items)
List.AllIndicesOf({1,2,3,4},{3,4})

List.AddItemToFront

List.AddItemToFront(item,List0)
List.AddItemToFront(0,{1,2,3,4})

List.AddItemToEnd

List.AddItemToEnd(item,List0)
List.AddItemToEnd(5,{1,2,3,4})

Sequence

start..#amount..step

Write integer numbers or floating numbers or variables in code block to make a sequence. First number is start range, second is the amount of items in the sequence list and third is step. Between numbers insert dot dot.

Sequence default

Sequence by default starts at 0, the total amount of items is 10 and the step is 1. To do the same with Code Block just write 0..#10..1
First number is the start, dot dot, then use hash sign before second number to assign the amount, dot dot, finally the step. In this case the step cannot be tacit.

Range

Write integer numbers or floating numbers in code block to make a range using double dots. First number is start range, second is end and third is step. Between numbers insert dot dot.
You can use also variables instead of simple number.

Range step 1

n..m

You can use variables to create a range list from Code Block. Just use double dots.

Range default

Range by defaul starts at 0, ends at 9 and the step is 1. To do the same with Code Block just write 0..9
The first number is the start, dot dot, the second is the end. The step 1 is tacit.

Thursday 1 December 2016

Range & Sequence & something more...


List.Create


{List1,List2,List3,List4}

Use curly brackets to create a List and use commas to separate arguments of the list.

File.FromPath


File.FromPath(PATH)

Directory.FromPath

Directory.FromPath(PATH)

Directory Path



Directory Path is like a String. Write your path between quotation marks.

File Path



File Path is like a String. Write your path between quotation marks.

True False



Simply write true or false (lowercase). Be careful, Dynamo is Case Sensitive!

Number



Write your number in code block like you would in the number node.

String



Use Quotation Mark in code block to write a string.