找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 600|回复: 0

[ARX程序]:版主和高手指点,困扰我很久了,急呀

[复制链接]
发表于 2008-9-19 12:26:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我想在模型空间中选一多边形,然后在布局空间把这个多边形区域用视口剪切出来,可用旋转和缩放.现在我在旋转时发现视口边界里面的图形与模型空间的多边形不完全重合,缩放是没有问题的.

       AcDbViewport *pViewport = new AcDbViewport();
        pViewport->setCenterPoint(AcGePoint3d(printableXmin/2+printableXmax/2, printableYmin/2+printableYmax/2,0));       
        double width,height;width=0;height=0;
        width=GetViewportWidth(trimobjectid);
        height=GetViewportHeigth(trimobjectid);
        pViewport->setHeight(height);
        pViewport->setWidth(width);
        AcGePoint3d rotatemodelcenterpt;
        rotatemodelcenterpt=GetModelSpaceObjectCenter(entId);
        rotatemodelcenterpt=rotatemodelcenterpt.rotateBy(twistangle,AcGeVector3d(0,0,1));       
        pViewport->setViewCenter(AcGePoint2d(rotatemodelcenterpt.x,rotatemodelcenterpt.y));       
        pViewport->setLensLength(50.0);               
        pViewport->setNonRectClipEntityId(trimobjectid);
        pViewport->setNonRectClipOn();
        pViewport->setViewHeight(height*scale);
        pViewport->setViewDirection(AcGeVector3d(0,0,1));
        pViewport->SetViewPortScale(pViewport,scale);
        pViewport->setTwistAngle(twistangle);
        // 将新的布局对象添加到图纸空间块表记录中
        AcDbObjectId viewportId;
        pBlkTblRcd->appendAcDbEntity(viewportId, pViewport);
        //pViewport->downgradeOpen();
        pViewport->setOn();
        pViewport->upgradeOpen();
        pViewport->close();
        pBlkTblRcd->close();
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-9-24 06:25 , Processed in 0.335903 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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