Use this function, this how you make a parametric modeller, you can swap the shape of an ais and update it, this is straight from OpenShapeFactory.
void HSF::updateAIS(TopoDS_Shape aShape, Handle_AIS_Shape &anAIS, Handle_AIS_InteractiveContext ic)
{
if(aShape.IsNull()) return;
if (anAIS.IsNull()){
anAIS=new AIS_Shape(aShape);
ic->SetMaterial(anAIS,Graphic3d_NOM_NEON_GNC);
ic->SetColor(anAIS, Quantity_NOC_BLACK);
ic->SetDisplayMode(anAIS,1,Standard_False);
}
if (!anAIS->HasPresentation()){
ic->Display(anAIS, 1,0,false,false);
}
else
{
anAIS->Set(aShape);
ic->Deactivate(anAIS);
ic->Redisplay(anAIS,true,true);
}
ic->Update(anAIS,true);
ic->CurrentViewer()->Redraw();
}
Best,
AlexP