Struggle with python code

hello:) i have a struggle with my python code. as you can see on the picture i tried to replace the functions of the pink surrounded Component ‘Surfaces’ with a python3 component and a code i wrote. now i have the problem that my code is not incorrect but it does not change anything of my surface i modelled in rhino so it looks empty there and no picture is generated. i think the problem is that out of the untrimmed surfaces (see panel) it gets to only (lists). i dont know how to change - can someone please explain ? and help me with my code! THX :slight_smile:

import Rhino.Geometry as rg
import math

# --- Eingaben in Listen umwandeln ---
if not isinstance(G, list):
    G = [G]
if not isinstance(A, list):
    A = [A]

# --- Achse vorbereiten ---
if hasattr(AX, "PointAtStart") and hasattr(AX, "PointAtEnd"):
    start = AX.PointAtStart
    end = AX.PointAtEnd
    axis_vector = end - start
else:
    raise ValueError("AX muss eine Curve sein")

result = []

for geom in G:
    if geom is None:
        continue

    # --- GH-kompatible Objekte ---
    geo = None
    if isinstance(geom, rg.Curve):
        geo = geom
    elif isinstance(geom, rg.Surface):
        geo = geom.ToBrep()  # WICHTIG: Surfaces als Brep
    elif isinstance(geom, rg.Point3d):
        geo = geom
    else:
        # Falls GH Brep direkt
        try:
            geo = rg.Brep.TryConvertBrep(geom)[0]
        except:
            geo = None

    if geo is None:
        continue

    # --- Für jeden Winkel kopieren und rotieren ---
    for angle in A:
        rad = math.radians(angle)
        xform = rg.Transform.Rotation(rad, axis_vector, start)
        dup = geo.Duplicate()
        if dup is not None:
            dup.Transform(xform)
            result.append(dup)

T = result

type or paste code here

Please post your Grasshopper definition or paste code using the preformatted text option…

Pasting the code should look like this so you have all code in one box:

import Rhino.Geometry as rg
import math

# --- Eingaben in Listen umwandeln ---
if not isinstance(G, list):
    G = [G]
if not isinstance(A, list):
    A = [A]

....

T = result

so i’d only change the first code lines and all others can remain? i’m very much a beginner in python :II Thanks for your answer!!

My comment was only about the formatting of posting code in the forum. I can’t help you with the code.

Thanks, now i understand! but can you see the Grashopper canvas?:slight_smile:

I can see your screenshot but I can’t see what’s wrong. Unless there is a really simple and obvious error, screenshots are not suitable for troubleshooting.

Okay, i uploaded what my rhino modeeling for better understanding: you see on the picture my model facade on the left everything modeled only with GH now my question from above i tried to do the same thing but i replaced the geometry component with python scripting but it ends up having no facade like on the left side of the facade and i dont know what i did wrong.