How to make{0:0} to {0} in code?


(Andrealu2012) #1


i know we can right click the LC to use flatten.but, this time i need do the same thing in C# …
Thankyou!


(Shridhar_Mamidalaa) #2

Simplify.


(Michael Pryor) #3

Simplify won’t work in that case when it has no other branches to simplify against, a common complaint about simplify.


(Andrealu2012) #4

List class has not simplify in C#…


(Michael Pryor) #5

Use IGH_Structure
https://developer.rhino3d.com/wip/api/grasshopper/html/M_Grasshopper_Kernel_Data_IGH_Structure_Simplify.htm

But again that won’t do it, the description is “Simplify the data structure by removing path indices shared by all branches.” In your case there is no other branches to compare to"


(Andrealu2012) #6

thankyou ,but it looks too difficult to me!


(Andrealu2012) #7

i use a structure.flatten(ghpath)to flatten a tree.it works.


(Pfotiad0) #8

See attached (for the “general” case of doing Lexer ops).

Lexer_ops_V1A.gh (9.0 KB)