在C++代码中设置创建的named boundary属性

老师请问一下我C++代码创建的named boundaries 该怎么设置上面的属性(上图为界面创建的named boundary).

我在c++库中看见有一个NamedBoundaryClipDepths 类这个该怎么去用,老师这边有没有例子

pts[0].x = 30000 * g_1mu1;
pts[0].y = 0;
pts[1].x = 40000 * g_1mu1;
pts[1].y = 0;
pts[2].x = 40000 * g_1mu1;
pts[2].y = 10000 * g_1mu1;
pts[3].x = 30000 * g_1mu1;
pts[3].y = 10000 * g_1mu1;
if (SUCCESS == ShapeHandler::CreateShapeElement(eehShape, NULL, pts, 4, ACTIVEMODEL->Is3d(), *ACTIVEMODEL))
{

//eehShape

eehShape.AddToModel();
namedptr = NamedBoundary::Create();
namedptr->SetModelRef(ACTIVEMODEL);
namedptr->SetName(L"testview");
namedptr->SetDrawingScale(1.0);
namedptr->SetGraphicalElement(eehShape);
namedptr->Save();
boundarygrop->InsertBoundary(namedptr);
boundarygrop->WriteToFile();

//设置named boundary 属性(剪切深度等)

Parents Reply
  • 只需要在创建的graphicalElement后调用我说的这个函数即可。示例代码如下:

    void createNamedBoundary(WCharCP)
    {
    	DPoint3d pts[4] = { {0,0,0}, {1000,0,0}, {1000, 500,0}, {0,500,0} };
    	EditElementHandle eeh;
    	ShapeHandler::CreateShapeElement(eeh, nullptr, pts, 4, ACTIVEMODEL->Is3d(), *ACTIVEMODEL);
    	NamedBoundaryClipDepths::AppendToElement(eeh, 50, 60, true, false);
    	eeh.AddToModel();
    
    	NamedBoundaryPtr pBoundary = NamedBoundary::Create();
    	pBoundary->SetModelRef(ACTIVEMODEL);
    	pBoundary->SetName(L"MyNamedBoundary");
    	pBoundary->SetDrawingScale(1.0);
    	pBoundary->SetGraphicalElement(eeh);
    	pBoundary->Save();
    }



    Answer Verified By: chen chen 

Children
No Data