I am trying to project a random selection of objects onto a surface, using the PullCurve function. Since projection is only possible for curves, and will generate an error message when a non-curve object is selected, I am filtering out the curves with IsCurve. Here is the code part:
rs.UnselectAllObjects() for pully in pulllist: if rs.IsCurve(pully): resultcurve=rs.PullCurve(cookiesurface,pully) if resultcurve: rs.SelectObject(resultcurve)
Trying it, it was a hit-and-miss. Sometimes it worked, sometimes it came up with a message regarding the SelectObject function: "argument requires a guid or a string representing a guid"
I found out that this happened when the selection included a Text Block, and after more research that a Text Block is actually a tuple of two guides. Changing the argument to
resultcurve solved the problem, although there is no visible evidence of the projected Text Block (which is fine).
What puzzles me is how the Text Block got past the IsCurve filter. Anybody an explanation?
Edit: I reversed the change in the script, and it still works without error messages, go figure!