Hi All, i am trying to add A,B,C,D… to my sublist as per no of elements in that sublist.
But i don’t want add any value to the sublist which only has one element.
Can anyone help me out to sort it.
Hi All, i am trying to add A,B,C,D… to my sublist as per no of elements in that sublist.
But i don’t want add any value to the sublist which only has one element.
Can anyone help me out to sort it.
Try this:
m= n==1 ? 0 : m; //replaces a value of 1 with a value of 0.
lists = “A”..#m..1;
Thanks @jacob.small for your quick response, i needed to change the wording a bit but it worked well.
is there anyother way to remove empty list with ( " ") , i have used node “List.ReplaceEmptyLists”.
Much appreciated
And now I see the intent.
This would be a great custom node.
List.BuildSuffix
which takes a nested list as the first input, and a list containing the suffix sequence…
Mr. @jacob.small , It worked as well
thanks for your quick response
I have marked it as a solution
I tried in python but I think I still have work to do
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
def pref(a):
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if a>1:
return [alphabet[i] for i in range(a)]
else:
return [""]
elt=UnwrapElement(IN[0])
OUT = [pref(len(elt[j])) for j in range(len(elt))]
cordially
christian.stan
yes it is working get thanks, finally i am able to sort my pile as per coordinates with the help of SpLine
Many thanks