Can't figure out out to "-Hide" within C# components

I’m using the below code to select all my meshes to some work down the line inside of grasshopper. I would like to hide what ever objects this script selects. I can’t seem to figure it out.

I tried using RhinoApp.RunScript("-Hide", true);
but I still have to manually select the object.

I feel like I should be using this "ObjectAttributes.AddHideInDetailOverride
" Rhinocommon item, but I’m unsure how.

Moved to Developer category

Once you get the id of the referenced geometry, you could use:
Rhino.RhinoDoc.ActiveDoc.Objects.Hide(id, True)

I’m not great with C#, but maybe this python example helps?
If the geometry is already referenced into a component, (example; a geometry parameter) on the canvas, it might look like this:

refIds = []

def getRefGeoId():
    ghdocObjs = ghenv.Component.OnPingDocument()
    for obj in ghdocObjs.Objects:
        if obj.SubCategory.ToString() == "Geometry":
            for pobj in obj.PersistentData:
                if pobj.IsReferencedGeometry:

def HideRefGeo():
   for id in refIds:
       Rhino.RhinoDoc.ActiveDoc.Objects.Hide(id, True)

Thanks Chanley,
That was a pretty simple fix!

I slightly modified Rhino.RhinoDoc.ActiveDoc.Objects.Hide(id, True) to work with C# Rhino.RhinoDoc.ActiveDoc.Objects.Hide(obj.Id, true);

and it worked!

Thanks again