V6 selboundary broken? specifically on text?

i just noticed that a script i had working before based off selboundary doesn’t work anymore but works fine in 5.

even the default selboundary doesn’t grab text in v6. has something changed? is there something wrong with the script?

Private oldSelMode
If IsEmpty(oldSelMode) Then oldSelMode = "Window"
	
Call MultiSelBoundary()
Sub MultiSelBoundary()

	Dim msg,arrCrvs,arrOpts,strOpt,match,i	
	msg = "Select closed curves as selection boundaries"
	arrCrvs = Rhino.GetObjects(msg, 4,, False)
	If Not IsArray(arrCrvs) Then Exit Sub
	
	arrOpts = Array("Window", "Crossing", "InvertWindow", "InvertCrossing")
	strOpt = Rhino.GetString("Selection mode?", oldSelMode, arrOpts)
	
	match = False
	For i=0 to 3
		If strOpt = arrOpts(i) Then match = True : Exit For		
	Next
	If not match Then Exit Sub	
	oldSelMode = strOpt
	
	Dim arrColl,strCrv,arrSelObjs,strComm,strGroup
	
	Call Rhino.EnableRedraw(False)	
	arrColl = Array()
	strComm = "_Selboundary _SelectionMode=" & strOpt & " _SelID "
	
	For each strCrv in arrCrvs
		Call Rhino.UnselectAllObjects
		If Rhino.IsCurveClosed(strCrv) Then
			Call Rhino.Command(strComm & strCrv, False)
			Call Rhino.SelectObject(strCrv)
			arrSelObjs = Rhino.SelectedObjects(True)
			If IsArray(arrSelObjs) Then
				'add group and group objects
				strGroup = Rhino.AddGroup()
				Call Rhino.AddObjectsToGroup(arrSelObjs, strGroup)
				arrColl = Rhino.JoinArrays(arrColl, arrSelObjs)				
			End If			
		End If
	Next
		
	If Ubound(arrColl) > -1 Then 
		'arrColl = Rhino.CullDuplicateStrings(arrColl, False)
		Call Rhino.SelectObjects(arrColl)
		'reporting to command line
		Call ReportSelectedObjects(arrColl)		
	End If	
	'Call Rhino.UnselectObjects(arrCrvs)	
	Call Rhino.EnableRedraw(True)
End Sub

Sub ReportSelectedObjects(objs)
	Dim obj,typ,pts,ptc,crv,srf,ps,msh,lts,ann,blk,dot,hat
	For each obj in objs
		typ = Rhino.ObjectType(obj)
		Select Case typ
			Case 1 : pts = pts + 1
			Case 2 : ptc = ptc + 1
			Case 4 : crv = crv + 1
			Case 8 : srf = srf + 1
			Case 16 : ps = ps + 1
			Case 32 : msh = msh + 1
			Case 256 : lts = lts + 1
			Case 512 : ann = ann + 1
			Case 4096 : blk = blk + 1
			Case 8192 : dot = dot + 1
			Case 65536 hat = hat + 1
		End Select
	Next
	
	Dim rep
	If pts Then rep = rep & Cstr(pts) & " point"
	If pts > 1 Then rep = rep & "s"
	If pts Then rep = rep & ","
	If ptc Then rep = rep & " " & Cstr(ptc) & " point cloud"
	If ptc > 1 Then rep = rep & "s"
	If ptc Then rep = rep & ","
	If crv Then rep = rep & " " & Cstr(crv) & " curve"
	If crv > 1 Then rep = rep & "s"
	If crv Then rep = rep & ","
	If srf Then rep = rep & " " & Cstr(srf) & " surface"
	If srf > 1 Then rep = rep & "s"
	If srf Then rep = rep & ","
	If ps Then rep = rep & " " & Cstr(ps) & " polysurface"
	If ps > 1 Then rep = rep & "s"
	If ps Then rep = rep & ","
	If msh Then rep = rep & " " & Cstr(msh) & " mesh"
	If msh > 1 Then rep = rep & "s"
	If msh Then rep = rep & ","
	If lts Then rep = rep & " " & Cstr(lts) & " light"
	If lts > 1 Then rep = rep & "s"
	If lts Then rep = rep & ","
	If ann Then rep = rep & " " & Cstr(ann) & " annotation"
	If ann > 1 Then rep = rep & "s"
	If ann Then rep = rep & ","
	If blk Then rep = rep & " " & Cstr(blk) & " block instance"
	If blk > 1 Then rep = rep & "s"
	If blk Then rep = rep & ","
	If dot Then rep = rep & " " & Cstr(dot) & " text dot"
	If dot > 1 Then rep = rep & "s"
	If dot Then rep = rep & ","
	If hat Then rep = rep & " " & Cstr(hat) & " hatch"
	If hat > 1 Then rep = rep & "s"
	If hat Then rep = rep & ","
	rep = Left(rep, (len(rep) - 1)) & " added to selection"
	Call Rhino.Print(rep)
End Sub

Dunno, SelBoundary seems to work here on text objects in V6 (just the normal Rhino command). Script seems to work as well (1 test with defaults).

this is strange, some of these curves work and others don’t. if you have time can you open this file and try selboundary on some of them, again some work others don’t.selboundary.3dm (371.6 KB)

@Helvetosaur

here’s an example file and a screen capture.

selboundary.3dm (55.0 KB)

@pascal any ideas?

Yeah, this is messed up - after playing around with it a bit, I think I see what is causing it, but not why.

Both texts have a ‘model space scale’ assigned of 10 in the texts’ annotation properties. On the one that doesn’t select (‘not here’), if you reduce that to somewhere between 1 and 3, the boundary selection works… higher than that, it stops working. Conversely, if you raise the model space scale on the one that does select to over 12, it no longer selects.

On the first one (‘not here’) also, if you scale up the boundary curve a bit, the selection works. On the second one, if you scale down the boundary curve somewhat, it stops working.

This leads me to believe that SelBoundary is taking into account the model space scale factor of the annotation style (and getting it wrong) in its calculation - even though on screen you don’t see any difference if you change the factor, somehow Rhino now thinks the annotation is bigger/smaller than it appears on screen and thus no longer entirely inside the selection (window) boundary.

Definitely buggy, but as annotations have become a complete can o’ worms in V6, this doesn’t surprise me all that much.

thanks for the thorough investigation. i’m glad you finally saw it in action and could replicate it as I thought I was goose chase.