www.mxdraw.com
内容索引主面
前一个向上下一个
MxDraw::CreateViewport1 方法

创建视口

C++
static McDbObjectId CreateViewport1(McGePoint3d ptLB, McGePoint3d ptRT, McGePoint3d ptTargetLB, McGePoint3d ptTargetRT, McDbBlockTableRecord* pBlockRecord = NULL);
参数 
说明 
McGePoint3d ptLB 
视口左下角 
McGePoint3d ptRT 
视口右上角 
McGePoint3d ptTargetLB 
模型空间的显示范围左下角 
McGePoint3d ptTargetRT 
模型空间的显示范围右上角 

成功,返回视口对象id.

例如: C++

    void CTestCommands::CreateViewPort()
    {
        McDbDatabase* pDatabase = Mx::mcdbCurDwg();
        if(pDatabase->currentLayoutId() != pDatabase->modelLayoutId() )
        {
            Mx::mcutPrintf(_T("n 必须在模型空间选择显示内容"));
            return;
        }

        MrxDbgUiPrPoint getPt(_T("点矩形范围点1"));
        if(getPt.go() != MrxDbgUiPrPoint::kOk)
            return;
        McGePoint3d firstPt = getPt.value();

        ads_point   retPt;
        if(Mx::mcedGetCorner(asDblArray(firstPt),_T("n 点矩形范围点2:"),retPt) != RTNORM)
            return;

        McGePoint3d secondPt = asPnt3d(retPt);

        if(Mx::mcdbHostApplicationServices()->layoutManager()->setCurrentLayout(_T("layout1")) != Mcad::eOk )
        {
            //ASSERT(0);
            return;
        }


        McGePoint3d ptLB(10,10,0.0);
        McGePoint3d ptRT(100,100,0.0);

        McDbObjectId id = MxDraw::CreateViewport1(ptLB,ptRT,
            firstPt,secondPt
            );

        if(id.isNull())
        {
            AfxMessageBox(_T("创建失败!"));
            return;
        }
        else
        {
            AfxMessageBox(_T("创建成功!"));
            Mx::ZoomE();
        }
    }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!