[讨论]谁用过AcAxRotate函数?
// 在XOY平面上旋转实体Acad::ErrorStatus CModifyEnt::Rotate(AcDbObjectId entId,
AcGePoint2d ptBase, double rotation)
{
COleSafeArray sa;
DOUBLE dValues[] = {ptBase.x, ptBase.y, 0};
sa.CreateOneDim(VT_R8, 3, dValues);
VARIANT *pVariant = (LPVARIANT)sa;
if (SUCCEEDED(AcAxRotate(entId, *pVariant, rotation)))
{
return TRUE;
}
else
{
return FALSE;
}
}写了上面的这个函数,但是编译时提示找不到AcColor的定义,不知道是不是我的开发包的问题,请大家帮忙给测试一下。王版主能够帮忙在2004下测试一下?
回复
引用以下头文件,注意先后顺序:#include "acadi.h"<BR>#include "axboiler.h"
static void Rotate(AcDbObjectId entId, <BR> AcGePoint2d ptBase, double rotation)<BR> {<BR> COleSafeArray sa;<BR> DOUBLE dValues[] = {ptBase.x, ptBase.y, 0};<BR> sa.CreateOneDim(VT_R8, 3, dValues);<BR> <BR> VARIANT *pVariant = (LPVARIANT)sa;<BR> <BR> if (SUCCEEDED(AcAxRotate(entId, *pVariant, rotation)))<BR> {<BR> }<BR> else<BR> {<BR> }<BR> <BR> }
// ----- AcAxRotate_Test._rot command (do not rename)<BR> static void AcAxRotate_Test_rot(void)<BR> {<BR> // Add your code for command AcAxRotate_Test._rot here<BR> int rc;
ads_name en;<BR> ads_point pt;
AcDbObjectId eId;
rc = acedEntSel("\nSelect an entity: ", en, pt);
if ( rc == RTNORM )<BR> {<BR> rc = acdbGetObjectId(eId, en);
AcGePoint2d basePt(0,0);<BR> Rotate(eId,basePt,45);<BR> }<BR>
测试程序,命令: ROT
顺便问一句,测试没有问题吧,呵呵。
回复
能够正常运行,Rotate实体.
页:
[1]