How to use the Sublist function?? (and others list functions)

Hello Good Bentley community,


I'm having a great time learning generative components using the "Generative Components V8i Essentials"  provided in the student server,

The only problem is that it seems outdated, regarding the last version of GC, so now I find myself trying to complete the exercise in page 103 (from the PDF page Count, the document page number will be 93) about "Sublist" list function (and all the other list functions).

Can anyone explain me how to use this function correctly?

So I can master this wonderful toll

Best Regards

  • Hi Rafael,

    All the list functions are now being provided as methods on any object that is a list. So, if you have a list (e.g. point05 in the Essentials --even though there appears some confusion with point05 and point06 in that document), then all the list functions are available as methods when looking at the dot properties of that node containing a list of constituent nodes. Among those is also Sublist as point05.Sublist(firstindex, count). "firstindex" is the index to the first list member that needs to be added to the sublist, and "count" how many members of the donor list are contained in the sublist. The default of adding all remaining list members to the sublist would be point05.Sublist(firstindex, point05.Count - firstindex).

    The Sublist function still works in GC CONNECT Edition, too, even though it is not listed in the Functions dialog. However, the trend is toward supporting list methods on all list objects. Any gaps there should be reported so we can ensure full coverage.

    HTH and have fun with GC!

    Volker

       

  • Thank you so Much Volker,

    I was able to understand the new methods, still I need some training and study to do but a lot makes sense now.

    GC has been an obsession that I can finally put some time to understand and develop my skills

    Best Regards

    Rafael