
Wed, 04/22/2009 - 11:19
Forums:
Hi, All,
I use LineDriver to create several lines on certain plane. After that that, I want to select them for Extrusion. But When I click any vertex, edge, and face, neural section button. These lines dispear. Following is the example of edge selection function.
//Set edges selection mode
void CMyView::OnSelEdges()
{
GetDocument()->GetAISContext()->CloseAllContexts();
GetDocument()->GetAISContext()->OpenLocalContext();
GetDocument()->GetAISContext()->ActivateStandardMode(TopAbs_EDGE);
}
Does anyone has this expericens? Thanks in advance!
Rdgs
Chris
Wed, 04/22/2009 - 12:32
Most likely you created the shape in a Local Context and didn't tell the AISContext to keep it. Once the context is closed, all shapes added to it are removed.
Wed, 04/22/2009 - 12:38
Thanks. You are correct. Because I selected a face with local context open as datum plane before, and didn't close it when generated these lines.
But I now find I cannot retrieve these lines after close the document. Because there is no TNaming_NamedShape attribute saved in the OCAF tree. I don't know how does it happen.
Thanks.
Wed, 04/22/2009 - 12:32
From the OCAF tree, I find there is no attribute of "TNaming_NamedShape" for the "Line", while "Box" and "Cylinder" which I use sample code generated has the attribute of "TNaming_NamedShape" with value "SOLID PRIMITIVE".
I don't know how has it been generated?
Thanks!
Thu, 04/23/2009 - 05:08
I got it. It is because I forgot to register the line driver with driver table.
Thanks.