Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5800

Text block is a curve?

$
0
0

@maxz wrote:

Hi,
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:
pulllist= rs.SelectedObjects()

	rs.UnselectAllObjects()

	for pully in pulllist:
		if rs.IsCurve(pully):
			resultcurve=rs.PullCurve(cookiesurface,pully)
			if resultcurve:
				rs.SelectObject(resultcurve[0])

	rs.ShowObject(cookiecurve)
	rs.SelectObject(cookiecurve)

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[0] 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?

Max.

Edit: I reversed the change in the script, and it still works without error messages, go figure!

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5800

Trending Articles