Geometry Generating Components Preview Problems

I’m trying to create geometry components programmatically.
Using this code I can create almost any component including geometry creating components.
var component = new … whatever geometry component like a simple loft();
component.Attributes.Pivot = someCoordinatePivot;
this.OnPingDocument().AddObject(component, true);

However, when I select that component it does not highlight it in the Rhino viewport like components made in a normal way.

@DavidRutten I would really appreciate your guidance on this. This is almost the last thing I need to fix for my plug-in.

I have used the " RepairParamAssociations" method to fix the problem. But the documentation says “If you stick to regular functions, you shouldn’t have to call this.”
I’m wondering what are the “regular” functions that I should use.