For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

How to move an AIS_SHAPE????

viviana andrea agudelo moreno's picture

Hi, I need help

I tried to move a sphere which is an AIS_SHAPE but I didn't get it. I think maybe jooo can help me.


Hugues's picture

You can move an AIS_Shape or more generally an AIS_InteractiveObjet with the procedure AIS_InteractiveContext::SetLocation.
It takes the interactive object to move, and the move as a transformation.
Transformations are gp_Trsf objects.

To translate an item to P(x, y, z) do :
gp_Trsf move;
move.SetValues (1, 0, 0, x,
0, 1, 0, y,
0, 0, 1, z,
angular_tol, confusion_tol);
ais_context->SetLocation (ais_shape, move);

viviana andrea agudelo moreno's picture

Hi Hugues

Thank you very much, It worked.

Madesh R's picture

its not working for me,Here is the procedure that i followed

  BRepPrimAPI_MakeSphere mkSphere2(5.0);
     TopoDS_Shape Sphere2=mkSphere2.Shape();

Handle(AIS_Shape) AISsphere2=new AIS_Shape(Sphere2);
 gp_Trsf move;
 move.SetValues(10, 0, 0, 500,
 0, 10, 0, 100,
 0, 0, 1, 0);
 AISContext->SetLocation (AISsphere2, move);
  AISContext->SetDisplayMode (AIS_Shaded);

Irrespective of x,y,z values the sphere location is intact.Please help.

Kirill Gavrilov's picture

Your code produces expected result within current OCCT (although for certain you are using some obsolete version), so I don't see your problem.


Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.