I’ve written a script to extrude a curve along a path. I pick the path curve, insert a block at the start point of that curve, explode the block so it is a curve, then extrude that curve along the path:
ExtrudePath = rs.GetObject(“Pick the path”)
sp = rs.CurveStartPoint(ExtrudePath)
I would like to do the same thing to sweep along 1 rail. I use the same code to define the path and shape but at the end use:
But this doesn’t work. I get the message: iteration over non-sequence of type Guid
However, if I add the line:
shape = rs.GetObjects(“Select stiffener”)
and select the exploded block, then:
it works. And this only works with GetObjects (plural) and not GetObject.
The “brackets” create a list. A list is a basic python structure. Lots of info in the python online docs about lists.
@ckline You should perhaps also look at the rhinoscriptsyntax help file for the method, which gives you a lot of info, as well as start to understand what python error messages mean - they are actually quite succinct as well as helpful in debugging.
Unfortunately, @dale, @steve, @dan the new online help is not nearly as helpful as the old chm help, which specifically spells out that it wants a list:
@ckline The python error message is also telling you the same thing - although a bit more arcanely:
iteration over non-sequence of type Guid
Which simply means it expects something to iterate over like a list or a tuple (a “container” for one or more items), but it only got one item not in a container - a single GUID of one object - which is not “iterable”, so the method didn’t know what to do - so you got that error message.