天气与日历 切换到窄版

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

Rotate3d with ObjectARX

[复制链接]

该用户从未签到

主题

0

回帖

2912

积分

管理员

积分
2912
发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
[code]int testfunc()

{

  // make sure that geom3d.arx is loaded

  acedArxLoad(_T("geom3d.arx"));

  ads_name pieces;

  ads_point Point1, Point2;

  Point1[X] =  1.0;

  Point1[Y] =  1.0;

  Point1[Z] =  0.0;

  Point1[X] = 10.0;

  Point1[Y] = 10.0;

  Point1[Z] = 10.0;

  ads_real  Angle = 32;



  //Select the entities you want to rotate

  acedSSGet( NULL,NULL, NULL, NULL, pieces );



  resbuf* pBuf = acutBuildList(RTSTR,_T("c:rotate3d"),

    RTPICKS, pieces, RTSTR, _T(""), RT3DPOINT, Point1,

    RT3DPOINT, Point2, RTREAL, Angle, RTNONE);



  resbuf* result=NULL;

  acedInvoke(pBuf,&result);

  acutRelRb(pBuf);

  if (result!=NULL)

    acutRelRb(result);



  return RTNORM;

}

Method #2

With ObjectARX, it is recommended that AcDbEntity::transformBy() is used instead of invoking ROTATE3D. For example, for each entity (ename) with AcGePoint3d start (start) and end (end) points for the axis, and the rotation angle (angle), you can perform the following:

  double pi =  3.14159265359;

  AcDbObjectId objId;

  acdbGetObjectId(objId, ename);

  AcDbEntity* pEnt = NULL;

  acdbOpenAcDbEntity(pEnt, objId, AcDb::kForWrite);

  AcGeMatrix3d mat;

  mat.setToRotation(angle * pi / 180, end - start, start);

  pEnt->transformBy(mat);

  pEnt->close();[/code]

 

 

 

 

Rotate3d with ObjectARX
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-11-1 11:31 , Processed in 0.123384 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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