找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 249|回复: 1

AcDbRotatedDimension 旋转你角度

[复制链接]

1

主题

0

回帖

55

积分

管理员

积分
55
发表于 2024-3-16 08:57:37 | 显示全部楼层 |阅读模式
void makeRotatedDim(AcGePoint3d pt1, AcGePoint3d pt2, double dAngle)
{

Acad::ErrorStatus es;
AcGePoint3d ptMid = getMidPoint(pt1, pt2);  // getMidPoint is one of my simple utilities
AcDbBlockTableRecord* blkRec;
AcDbDatabase *pCurDb;

pCurDb = acdbHostApplicationServices()->workingDatabase();

AcDbRotatedDimension* dim = new AcDbRotatedDimension;

dim->setXLine1Point(pt1);
dim->setXLine2Point(pt2);
dim->setRotation(dAngle);

dim->setHorizontalRotation(dAngle);
dim->useDefaultTextPosition();
dim->setDatabaseDefaults();

es = acdbOpenObject(blkRec, pCurDb->currentSpaceId(), AcDb::kForWrite);
acedAlert(acadErrorStatusText(es));

es = blkRec->appendAcDbEntity(dim);
if(es!=Acad::eOk) acutPrintf(采用T("\nError adding entity (%d)"), es);

blkRec->close();

dim->close();

return;

} // end of function makeRotatedDim()

 

 

 

 

AcDbRotatedDimension 旋转你角度

1

主题

0

回帖

55

积分

管理员

积分
55
 楼主| 发表于 2024-3-16 08:57:45 | 显示全部楼层
  1. AcDbRotatedDimension *pDim = (AcDbRotatedDimension *)pEnt;
  2.     AcGePoint3d xLine1 = pDim->xLine1Point();
  3.     AcGePoint3d xLine2 = pDim->xLine2Point();
  4.     AcGePoint3d dimLine = pDim->dimLinePoint();
  5.     bool isBlock = (xLine1 == AcGePoint3d::kOrigin && xLine2 == AcGePoint3d::kOrigin && dimLine == AcGePoint3d::kOrigin);
  6.     if(isBlock)
  7.     {
  8.         // explode dimension
  9.     }
  10.     else
  11.     {
  12.         ...
  13.     }
复制代码

 

 

 

 

AcDbRotatedDimension 旋转你角度
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|膜结构网

GMT+8, 2025-2-6 05:43 , Processed in 0.194024 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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