- UID
- 21889
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-12-25
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
#include "assoc.h"
void ef();
static CString test;
void ef()
{
struct resbuf *cmd;
CString str1,style;
ads_name name,adsname1;
ads_point point1;
str1.Format("请选择需要读出属性的块:");
acedEntSel(str1,adsname1,point1);
acdbNameSet(adsname1,name);
struct resbuf *da;
ads_real hight,angle,scale,wscale;
ads_point inpoint;
int i=0;
acdbEntNext(adsname1,adsname1);
da=acdbEntGet(adsname1);
if(da->rbnext!=0)
da=da->rbnext;
test.Format(assoc(1,da,test));
ads_real hightt=0.0;
hightt=assoc(40,da,hightt);
ads_point pnt;
*pnt=*assoc(10,da,pnt);
*(pnt+1)=*(assoc(10,da,pnt)+1);
*(pnt+2)=*(assoc(10,da,pnt)+2);
// AfxMessageBox(test);
while((da->restype==0)&&(da->rbnext!=0))
{
CString att,at1;
att.Format("ATTRIB");
at1.Format(da->resval.rstring);
if(att==at1)
{
while((da->rbnext!=0)&&(da->rbnext!=0))
{
if(da->restype==40)
hight=da->resval.rreal;
if(da->restype==41)
wscale=da->resval.rreal;
if(da->restype==10)
ads_point_set(da->resval.rpoint,inpoint);
if(da->restype==50)
angle=da->resval.rreal;
if(da->restype==41)
scale=da->resval.rreal;
if(da->restype==7)
{
style.Format(da->resval.rstring);
break;
}
if(da->restype==1)
{
str1.Format(da->resval.rstring);
i=1;
// break;
}
if(da->rbnext!=0)
da=da->rbnext;
else goto END;
}
cmd=acutBuildList(RTSTR,"style",RTSTR,style,RTSTR,"",RTSTR,"0",RTREAL,wscale,RTSTR,"0",RTSTR,"",RTSTR,"",RTSTR,"",0);
acedCmd(cmd);
cmd=acutBuildList(RTSTR,"text",RTSTR,"S",RTSTR,style,RTPOINT,inpoint,RTREAL,hight,RTREAL,angle,RTSTR,str1,0);
acedCmd(cmd);
}
else break;
acdbEntNext(adsname1,adsname1);
da=acdbEntGet(adsname1);
if(da->rbnext!=0)
da=da->rbnext;
else goto END;
}
END:
if(i==1)
{
cmd=acutBuildList(RTSTR,"explode",RTENAME,name,0);
acedCmd(cmd);
struct resbuf glv;
glv.restype=0;glv.resval.rstring="ATTDEF";glv.rbnext=NULL;
ads_name ssnamel,delname;
acedSSGet("P",NULL,NULL,&glv,ssnamel);
long length;
acedSSLength(ssnamel,&length);
for(int ijk=0;ijk<length;ijk++)
{
acedSSName(ssnamel,ijk,delname);
acedCommand (RTSTR, "_.erase", RTENAME, delname,RTSTR,"",RTNONE);
}
}
else
AfxMessageBox("没有选择有效的属性块!");
} |
|