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

Problem with AIS SELECTION

hamid reza's picture
Forums: 

I can retirive a vertex by AIS_SelectedShape. but not for first time I must select a vertex first and if I select second vertex after it I can retrive it by AIS_SelectedShape.

I use a code like this :

myAISContext->InitSelected(); if (myAISContext->MoreSelected()) { for (myAISContext->InitSelected(); myAISContext->MoreSelected(); myAISContext->NextSelected()) {

TopoDS_Vertex anV=TopoDS::Vertex(myAISContext->SelectedShape()); } }

if I select a vertex for first time MoreSelected fails and then if I use TopoDS_Vertex anV=TopoDS::Vertex(myAISContext->SelectedShape()); my programs fails!