Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8668

Get user datas on delete items

$
0
0

@Markus_Erhardt wrote:

Hi,
I am looking for the user Datas when we delete an Item.
To be more precise I have a list of list of differerent object who all recive "ObjectDatas"
List<List> myList;

ObjectDatas can be a UserData too. So it is useful because when reading the UserData from the selected object I now at which row in the List of List I have to look to find him.

I cannot give too much information on this thing and why. The only thing is that when deleting the objects, in the Events generated I need to get the User Data of this object-> but Rhino always said null reference ? Why?
example :

   private void RhinoDoc_DeleteRhinoObject(object sender, Rhino.DocObjects.RhinoObjectEventArgs e)
        {

            ObjRef obj_ref = new ObjRef(e.ObjectId);   -----------> This works
           var ud = obj_ref.Geometry().UserData.Find(typeof(ObjectDatas)) as ObjectDatas; //something give a NullReferenceException  Why ?????

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 8668

Trending Articles