Grasshopper

algorithmic modeling for Rhino

Well friends,

These 2 identical scripts (as regards logic) do what the thread header says.

However I would be glad on some advise related with case2 (the one that calls a function) - i have a strong feeling that very stupid things are made there (in the function declaration).

And given the opportunity: what about counting more "Levels"? (using Dictionary?).

best, Peter

Views: 608

Attachments:

Replies to This Discussion

I'm not 100% sure what the code is supposed to do, but I do have some recommendations:

  • Don't use class level variables unless you absolutely have to.
  • Use variable and parameter names that are descriptive. 'sc' is not good, I have no idea what it's supposed to mean.
  • Use function parameters that are as low in the inheritance hierarchy as possible. Don't use List<T> or T[] if you can get away with IEnumerable<T>, etc. etc.

Given the above, I'd write the function like so:

Attachments:

David,

grazie mille

PS: sc (meaning surface count) is used in the main script (was a left over): that makes variable type of trusses on any List of surfaces (trimmed or not), turns lines into MERO type of "assemblies", finds clash events, outlines secondary grids (roofing, facades etc), outputs to excel the drilling axis per node etc etc etc.

I'll post the whole script soon - I need "some" advice(s) as regards baking into nested blocks in order to properly translate (STEP) the dataset to CATIA/AECOsim and the likes.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service