|
16 | 16 |
|
17 | 17 | class PlateFromTopBottom(Grasshopper.Kernel.GH_ScriptInstance): |
18 | 18 | def RunScript( |
19 | | - self, |
20 | | - top: System.Collections.Generic.List[object], |
21 | | - bottom: System.Collections.Generic.List[float], |
22 | | - category: System.Collections.Generic.List[str], |
23 | | - updateRefObj: bool, |
| 19 | + self, Top: System.Collections.Generic.List[object], Bottom: System.Collections.Generic.List[object], category: System.Collections.Generic.List[str], updateRefObj: bool |
24 | 20 | ): |
25 | 21 | # minimum inputs required |
26 | 22 |
|
27 | | - if not list_input_valid_cpython(ghenv, top, "Outline") or not list_input_valid_cpython(ghenv, bottom, "Thickness"): |
| 23 | + if not list_input_valid_cpython(ghenv, Top, "Outline") or not list_input_valid_cpython(ghenv, Bottom, "Thickness"): |
28 | 24 | return |
29 | 25 | else: |
30 | 26 | if not category: |
31 | 27 | category = [None] |
32 | 28 | plates = [] |
33 | 29 | scene = Scene() |
34 | 30 | # check list lengths for consistency |
35 | | - if len(top) != len(bottom): |
| 31 | + if len(Top) != len(Bottom): |
36 | 32 | ghenv.Component.AddRuntimeMessage(Grasshopper.Kernel.GH_RuntimeMessageLevel.Error, " `Top` and `Bottom` must have the same number of elements.") |
37 | | - if len(category) not in (0, 1, len(top)): |
| 33 | + if len(category) not in (0, 1, len(Top)): |
38 | 34 | ghenv.Component.AddRuntimeMessage( |
39 | 35 | Grasshopper.Kernel.GH_RuntimeMessageLevel.Error, " In 'Category' I need either none, one or the same number of inputs as the `Top` parameter." |
40 | 36 | ) |
41 | 37 |
|
42 | 38 | # duplicate data if None or single value |
43 | | - if len(category) != N: |
44 | | - category = [category[0] for _ in range(N)] |
| 39 | + if len(category) != len(Top): |
| 40 | + category = [category[0] for _ in range(len(Top))] |
45 | 41 |
|
46 | | - for top_line, bottom_line, c in zip(top, bottom, category): |
| 42 | + for top_line, bottom_line, c in zip(Top, Bottom, category): |
47 | 43 | t_guid, t_geometry = self._get_guid_and_geometry(top_line) |
48 | 44 | b_guid, b_geometry = self._get_guid_and_geometry(bottom_line) |
49 | 45 | t_rhino_polyline = rs.coercecurve(t_geometry) |
|
0 commit comments