天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 5|回复: 0

arx函数

[复制链接]
  • TA的每日心情
    开心
    昨天 15:23
  • 签到天数: 69 天

    [LV.6]常住居民II

    410

    主题

    167

    回帖

    2704

    积分

    管理员

    积分
    2704
    发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
    //------------------------------------------------------------------------------
    void Goto(double dX, double dY, BOOL bZoom)
    //------------------------------------------------------------------------------
    {
            Acad::ErrorStatus es = Acad::eOk;

            AcDbDatabase* pDb = pApp->GetCurrentAcDb();

            if (pDb != NULL)
            {
                    // Get the viewport
                    es = acedVports2VportTableRecords();
                    AcDbViewportTable *pVpT = NULL;
                    AcDbViewportTableRecord *pActVp = NULL;
                    AcGePoint2d centerpt;
                    double height = 0.0L;
                    double width = 0.0L;

                    // Get the *Active view port
                    es = pDb->getViewportTable(pVpT, AcDb::kForRead);
                    if (pVpT != NULL)
                    {
                            es = pVpT->getAt(_T("*ACTIVE"), pActVp, AcDb::kForWrite);
                            es = pVpT->close();

                            if (pActVp != NULL)
                            {
                                    centerpt = pActVp->centerPoint();
                                    height = pActVp->height();
                                    width = pActVp->width();

                                    // Close the Active viewport
                                    es = pActVp->close();

                                    // Update the viewport
                                    es = acedVportTableRecords2Vports();
                            }
                    }

                    // Notify
                    CString sMsg = _T("");
                    sMsg.Format(RESSTR(IDS_MOVINGTO), dX, dY);
                    pApp->DisplayMessage(0, sMsg);

                    // This is the same as ZoomTo - but without the unit conversion
                    centerpt.x = dX;
                    centerpt.y = dY;

                    // Adjust for UCS
                    acdbUcs2Wcs((double*)(&centerpt), (double*)(&centerpt), false);

                    // Adjust zoom state based on design size if required
                    DocSettings* pDocSettings = pApp->GetDocSettings();
                    if (bZoom && pDocSettings != NULL)
                    {
                            DistanceUnit unit;
                            pApp->GetUnitSettings()->GetUserUnit(&unit);
                            DocSettings::DesignSizes Sizes = pDocSettings->GetDesignSizes();
                            double basesize = Sizes.m_BaseSymbolSize.GetConvertedValue(unit);

                            (height > 10.0L * basesize) ? height = 10.0L * basesize : height;
                            (width > 10.0L * basesize) ? width = 10.0L * basesize : width;
                    }

                    // Got specified point
                    if (height > 0.001 || width > 0.001)
                    {
                            AcDbViewTableRecord mVTR;
                            mVTR.setCenterPoint(centerpt);
                            mVTR.setHeight(height);
                            mVTR.setWidth(width);
                            es = acedSetCurrentView(&mVTR, NULL);
                    }
            }
    }

     

     

     

     

    arx函数
    中国膜结构网打造全中国最好的膜结构综合平台 ,统一协调膜结构设计,膜结构施工,膜材采购,膜材定制,膜结构预算全方位服务。 中国空间膜结构协会合作单位。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|

    GMT+8, 2024-7-1 05:49 , Processed in 0.056570 second(s), 22 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表