Python boolean and intersection if statement and guid

When removed line 7 the script works. When line 7 inserted it does not work, nor when I adjust the input type to brep.

What I am doing wrong?
Thank you for your response :slight_smile:

20190117 if statement guid thing (12.9 KB)

You’re using rhinoscriptsyntax! :wink:

20190117 pull point to offset (14.1 KB)


Thank you again pirateboy :smiley:
I read your comments in the file.

I am sorry, my script is getting so large, I made snapshots.

I have a question, somehow I cannot extend a list because it is a guide, so I made a curve of it, but that is not accepted either.

boolcrvs exists out of two curves, adding them is not allowed somehow

Do you know what I am missing here?

It is such like ‘Arrrr arrr,’ those dam* pythons [pirates of the carribean themed]…
EDIT: Ah wait, I see. something.

What the duck :duck: is happening here. When I print c (line 177) it does not take the System.Guid, but only the code of it.

Hmmmmm…. Do you might know why?
Just using extend does not work too.

The ‘Runtime error (TypeErrorException): Guid is not iterable’ was raised, because you tried to extend the object of type ‘list’ cuttingcrvs with a non-iterable object of type ‘guid’.
The ‘TypeErrorException’ part of the error tells you that something is wrong with the type of an object in your code. The type refers to what an object represents to the compiler (e.g. float, int, str, list, tuple, dictionary, etc.).
‘Guid is not iterable’ specifies that an object of type ‘guid’ can not be looped over, and hence is not an iterable type. Iterable types are for instance lists, tuples and dictionaries, or even proprietary Rhino specific object types, like rg.Point(), rg.Vector(), rg.PointCloud(), etc.

In Python, appending to a list, means adding the argument as a single element to the end of a list. The length of the list itself will increase by one.
Extending a list, on the other hand, iterates over its argument adding each element to the list, extending the list. The length of the list will increase by however many elements were in the iterable argument.
This means that you can basically only extend lists with lists!


a = [0, 1, 2, 3] # a list

print a
# outputs [0, 1, 2, 3, 4]

# raises a TypeErrorException, since 5 of type 'int' is not iterable

a.extend([5]) # [5] is of type 'list' with a length of 1 and is thus iterable
print a
# outputs [0, 1, 2, 3, 4, 5]

Or strings, sets, any iterable, :slight_smile:

1 Like