Accessing LeaderObject geometry and text

Thought this would be simpler. I have some leaders being generated that have some UserData. At some other part of the plugin, I search for these objects when a certain event is fired through

RhinoDoc.ActiveDoc.Objects.FindByUserString()

I can get the object as a LeaderObject, but this does not give me access to changing the DisplayText of the LeaderObject as it is read only. Also, other DocObjects classes (Such as LightObject) have a specific Geometry (for example LightGeometry) which makes it clear and simple to edit object specific properties.

I’d like to change the DisplayText and update the leader object. Am I overlooking something?

You can take a side way like:

            Dim MyObjList As New List(Of Guid)
            Dim MyObjects As DocObjects.RhinoObject() = RhinoDoc.ActiveDoc.Objects.FindByUserString("Hello", "Yes", False)

            For Each Obj As DocObjects.RhinoObject In MyObjects
                MyObjList.Add(Obj.Id)
            Next

            For Each Obj As Guid In MyObjList
                Dim LightObj As Geometry.Light = New DocObjects.ObjRef(Obj).Light
                'Edit the LightObj and do the stuff that you want
             Next

I know how to do it with lights, as I mention in my post.

My question is regarding LeaderObjects.

There is no ‘LeaderGeometry’ as there is ‘LightGeometry’ for Leader Objects.

Rhino.DocObjects.LeaderObject incomplete, I’ve adding an item so we can remember to tune it up a bit.

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

Ok, good to know. In the meantime, I suppose I can get its grips and DisplayText and remake the leader. It would be nice to have DisplayText and Grips be modifiable, perhaps this can go into a LeaderGeometry?

Any progress on this? I’m looking to pick a block and display its name in a leader.

The item in question is still open. But you should be able to create a leader. The reported issue was with modifying an existing leader.

p.s. I guess this could have been solved in the following manner:

    var obj = RhinoDocument.Objects.Find(id);
    var lo = obj as LeaderObject;
    var lg = lo.Geometry as Leader;
    lg.Text = "Hi World";
    obj.CommitChanges();