- UID
- 149510
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-6-14
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
#include "StdAfx.h"
#include "StdArx.h"
#include "string.h"
//-----------------------------------------------------------------------------
// This is command 'XY, by [2004-8-4], ,
void dimxy()
{
#ifdef OARXWIZDEBUG
acutPrintf ("\nOARXWIZDEBUG - dimxy() called.");
#endif // OARXWIZDEBUG
// TODO: Implement the command
ads_name ent;
ads_point p0,dimp,cp,p1,p2,pend;
if(acedEntSel("请选择实体:",ent,p0)!= RTNORM){
acutPrintf("取消操作!");}
struct resbuf *eb1=NULL,*eb2=NULL;
eb1=acdbEntGet(ent);
for(eb2=eb1;eb2!=NULL;eb2=eb2->rbnext)
{
if(eb2->restype==0)
if(strcmp(eb2->resval.rstring,"LINE")!=0)
{
if((strcmp(eb2->resval.rstring,"CIRCLE")!=0)&&(strcmp(eb2->resval.rstring,"INSERT")!=0)
&&(strcmp(eb2->resval.rstring,"ARC")!=0))
{acutRelRb(eb1);}
else
{
if(eb2->restype==10)
ads_point_set(eb2->resval.rpoint,cp);
dimp[X]=cp[X];
dimp[Y]=cp[Y];
dimp[Z]=cp[Z];
}
}
else
{
if(eb2->restype==10)
ads_point_set(eb2->resval.rpoint,p1);
if(eb2->restype==11)
ads_point_set(eb2->resval.rpoint,p2);
ads_real dis1=acutDistance(p0,p1);
ads_real dis2=acutDistance(p0,p2);
if(dis1 > dis2)
{dimp[X]=p2[X];
dimp[Y]=p2[Y];
dimp[Z]=p2[Z];}
else
{dimp[X]=p1[X];
dimp[Y]=p1[Y];
dimp[Z]=p1[Z];}
}
}
acutRelRb(eb1);
if(acedGetPoint(dimp,"\nPLEASE ENTER THE POINT:",pend) != RTNORM){
acutPrintf("取消操作!");}
else{
acedCommand(RTSTR,"DIMORDINATE",RT3DPOINT,dimp,RT3DPOINT,pend,0);
}
} |
|