马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
我们可以通过Options命令对话框里面的设置 Display Resolution 手工设置4个选项,如何通过API修改他们呢?
在通过API修改他们前,我们先看看这些变量的用途:
VIEWRES: Arc and circle smoothness, this sets the resolution for objects in the viewport.
SPLINESEGS: Segments in a polyline curve, this sets number of line segments to be generated for each spline-fit polyline generated by the spline objects of the PEDIT command.
FACETRES: Rendered object smoothness, adjusts the smoothness of shaded and rendered objects and objects with hidden lines removed.
ISOLINES: Contour lines per surface, specifies the number of contour lines displayed on the curved surface of 3D solids.
下面是代码:
- void changeDispRes()
- {
- AcDbDatabase *pDb = acdbHostApplicationServices()->workingDatabase();
- acutPrintf(_T("\n current SPLINESEGS value %d"),pDb->splinesegs());
- acutPrintf(_T("\n current FACETRES value %d"),pDb->facetres());
- acutPrintf(_T("\n current ISOLINES value %d"),pDb->isolines());
- pDb->setSplinesegs(8);pDb->setFacetres(0.75);pDb->setIsolines(6);
- AcDbObjectId curVportId = AcDbObjectId::kNull;
- curVportId = acedActiveViewportId();
- AcDbObjectPointer<AcDbViewportTableRecord> curVTR (curVportId,AcDb::kForWrite);
- if(curVTR.openStatus() == Acad::eOk)
- {
- acutPrintf(_T("\n current VIEWRES value %d"),curVTR->circleSides());
- curVTR->setCircleSides(100);
- }
- }
|