RhinoScript TextDot methods issue

Hi @dale,

Just ran into something weird - all the TextDot property methods (text, size, font and location) do not work if the object is not visible. Not sure if this is intentional or a bug; these are Properties and should be changeable even on hidden objects (like all other properties of objects). Rhino 5 SR12 64-bit. Makes my life difficult now.

'make any dot and try the below with- and without "hide"	
Dim idDot : idDot = Rhino.GetObject(, 8192)
	
Call Rhino.HideObject(idDot)

Call Rhino.TextDotText(idDot, "Test")
Call Rhino.TextDotPoint(idDot, array(0, 0, 0))
Call Rhino.TextDotHeight(idDot, 50)
Call Rhino.TextDotFont(idDot, "Tahoma")
    	
Call Rhino.ShowObject(idDot)

Thanks,

–jarek

I don’t believe this behavior is unique to text dots. RhinoScript, in general, does not modify what is not visible or locked. This is actually by design (in core Rhino).

Thoughts?

I am pretty sure it is. Everything else (including transforms and general properties like color, linetypes etc.) would happen to objects that are hidden, even the text dots. Only text-dot specific ones will not.
(I know deletion is not possible by default, you recently added extra argument to RS for that).

So - seems like the Dot properties are different than anything else. I don’t think it makes sense.

You can test changing of hidden objects with this:
/whether I hide or not, result is the same; also note dot changes its non-dot-specific properties…/

Dim idObject 

'try with circle
idObject = Rhino.AddCircle(Rhino.WorldXYPlane(), 10)

'or dot (non-dot specific properties
idObject = Rhino.AddTextDot(".", array(0, 0, 0))


Call Rhino.HideObject(idObject)

Call Rhino.ScaleObject(idObject, array(0, 0, 0), array(2, 2, 2), False)
Call Rhino.ObjectColor(idObject, vbRed)
Call Rhino.ObjectPrintWidth(idObject, 2)

Call Rhino.ShowObject(idObject)

This doesn’t work either:

Dim idDot : idDot = Rhino.GetObject(, 8192)
Dim idText : idText = Rhino.GetObject(, 512)
	
'Call Rhino.HideObjects(Array(idDot, idText))

Call Rhino.TextDotText(idDot, "Jarek")
Call Rhino.TextDotPoint(idDot, array(0, 0, 0))
Call Rhino.TextDotHeight(idDot, 50)
Call Rhino.TextDotFont(idDot, "Tahoma")

Call Rhino.TextObjectText(idText, "Jarek")
Call Rhino.TextObjectPoint(idText, array(10, 0, 0))
Call Rhino.TextObjectHeight(idText, 50)
Call Rhino.TextObjectFont(idText, "Tahoma")
    	
Call Rhino.ShowObjects(Array(idDot, idText))

So the behavior isn’t limited to text dots.

Like I said, RhinoScript, in general, does not modify what is not visible or locked because Rhino commands don’t. Transformation operations are the exception, as the object modification does through a different pipe (in core Rhino).

@pascal, any thoughts on this? Perhaps we should allow hidden/locked objects to be modified (since the scripter should know what they are doing…).

@dale,

I have just recently noticed the TextDot behavior, and now looks like you found that TextObject acts the same. For a long time I have been doing operations on sets of hidden objects just fine - as you can see from my previous example it is not only transformations, also color, material, linetypes, print parameters-all change while hidden – only with Dots (and now Text) I have noticed that some properties don’t change while hidden (I am talking scripting only).

I’d vote for having all act the same and allow modification of hidden objects (for any xform and property-like attributes).

thanks for looking into that.

–jarek

1 Like

I agree that should be allowed in a script.

-Pascal

I agree!

http://mcneel.myjetbrains.com/youtrack/issue/RH-31478