Python in grasshopper rhino

hi everyone
i am new to this forum and also new to python in grasshopper and python in general
i have a task in which i am supposed to create a surface and then use the python script component in grasshopper to divide the surface to 35by20 in u and v divisions and then create a diamond shaped curve in each cell then an offset for said curve , after that i am supposed to create surface panel using the offseted curves in each cell
the thing is i have been using ai to help with writing the script but it doesn’t understand the question when i ask about what other components i need to connect to both the inputs and the outputs of the python script component.
can someone please review the script and connect any necessary components, that would be so much appreciated.
thanks in advance!
hala mohammed python to hanan.3dm (42.1 KB)
hala mohammed python to (10.9 KB)

My first advice is do not use AI. The current state of AI will show misleading information just as confidently as it will show a solution. The only place we have seen it useful is when the result can be completely reviewed by someone that can allready debug the results.

Instead I would put trust in the humans experts on this forum. For instance here is a good thread to start with:

i have just got help from my tutor who just gave me the same advice ((:
but when i kept working on the code i recieved this error :
Runtime error (MissingMemberException): ‘NoneType’ object has no attribute ‘Offset’
now i am stuck ):
hala mohammed python to hanan.3dm (40.2 KB)
hala mohammed python to (24.9 KB)
the component is red.


This usually happens when you are trying to read an attribute from a data instance. For example, in this script:

print( x.Offset )

Offset is expected to be an attribute of whatever data that x contains. The error ‘NoneType’ object has no attribute ‘Offset’ really means that x does not have any value (it is None), and None does not have an Offset

Seems like this definition is passing a Curve into the script component, with type hint of Line. The component is showing an error about this:

That’s why the value of Crv in the script is None.

Using a Curve type hint for the Crv input works: