- UID
- 76992
- 积分
- 54
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-9-4
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
/////////////////////////////////////////////
程序目的:
在图内,通过鼠标选择第一字符串,把它复制内容下来,再选择第二个字符串,这时第二个字符串的内容变成和第一个字符串的内容相同!(实际上是字符串的内容复制)
[php]
// ObjectARX defined commands
#include "StdAfx.h"
#include "StdArx.h"
// This is command 'STRINGMATCH'
void corillastringmatch()
{
// TODO: Implement the command
ads_name ent1; //实体名变量
struct resbuf *cb=NULL,*ed=NULL; //缓冲区
// char changestr[20];
// if(acdbEntNext(NULL,ent1)!=RTNORM)
// {
// acutPrintf("当前图纸实间没有任何实体!");
// }
if((ed=acdbEntGet(ent1))!=NULL){ //取得实体
for(cb=ed;cb!=NULL;cb=cb->rbnext) //实体数据
{
if(cb->restype==0){ //断定所选实体是否为文本
if (strcmp(cb->resval.rstring,"TEXT")!=RTNORM) {
acutRelRb(ed);
acutPrintf("你选择的实体错误,请指定字符实体!");
}
}
if (cb->restype==1) { //修改文本内容
// acedGetString(20,"请输入要修改的字符串:",changestr);
strcpy(cb->resval.rstring,"11111");
}
if(acdbEntMod(ed)!=RTNORM){ //修改数据库
acutRelRb(ed);
acutPrintf("修改数据库出错!");
}
else{
acdbEntUpd(ent1); //更新文本
acutRelRb(ed);
}
}
}
acutPrintf("为空!");
acutRelRb(ed);
/* ed=acdbEntGet(ent2);
for(cb=ed;cb!=NULL;cb=cb->rbnext)
{
if(cb->restype==0){
if (strcmp(cb->resval.rstring,"TEXT")!=RTNORM) {
acutRelRb(ed);
acutPrintf("你选择的实体错误,请指定字符实体!");
}
}
if (cb->restype==1)
strcpy(cb->resval.rstring,changestr);
if(acdbEntMod(ed)!=RTNORM){
acutRelRb(ed);
acutPrintf("修改数据库出错!");
}
else{
acdbEntUpd(ent2);
}
break;
}
acutRelRb(ed);
*/
}
[/php]
整个程序经多次更改无法通过实现,出错在何处,望有人能指点迷津!感激不尽! |
|