- UID
- 12915
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-10-26
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
我想在模型空间中选一多边形,然后在布局空间把这个多边形区域用视口剪切出来,可用旋转和缩放.现在我在旋转时发现视口边界里面的图形与模型空间的多边形不完全重合,缩放是没有问题的.
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(); |
|