乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 58|回复: 3

请高手指点一二!

[复制链接]

5

主题

6

帖子

1

银币

初来乍到

Rank: 1

铜币
26
发表于 2005-8-22 21:23:00 | 显示全部楼层 |阅读模式
struct point
{double x,y,z;
};
int fk(point &ptMin, point &ptMax)
{    AcApDocManager *acDocManager;
    AcApDocument* pDoc = acDocManager->curDocument();
    acDocManager->lockDocument(pDoc);
    ads_point pt1,pt2;
    acedGetPoint(NULL,"Ñ¡¶¨×°ÔØ·¶Î§: ", pt1 );
    if(acedGetCorner(pt1,NULL,pt2)==RTCAN) return 0;

    if(pt1[X]unlockDocument(pDoc);

    return 1;

}

void :inifk()
{
    AcApDocManager *acDocManager;
    AcApDocument* pDoc = acDocManager->curDocument();
    acDocManager->lockDocument(pDoc);
    CString tmp,strtmp;
    strtmp+="zoom ";;
    tmp.Format("%-10.4lf",pMin.x);
    strtmp+=tmp;strtmp+=",";
    tmp.Format("%-10.4lf",pMin.y);
    strtmp+=tmp;
    tmp.Format("%-10.4lf",pMax.x);
    strtmp+=tmp;strtmp+=",";
    tmp.Format("%-10.4lf",pMax.y);
    strtmp+=tmp;strtmp+=" ";
//AfxMessageBox(strtmp);
    acDocManager->sendStringToExecute(pDoc,strtmp,true,false,true);
    acDocManager->unlockDocument(pDoc);


}
inifk();//初始化绘图范围
fk();//选择小部分绘图范围
两个函数连续执行有点问题
单个执行都没有问题。请高手指点一二!
qq :514341794 e-mail: gxglhnnywzk@tom.com
回复

使用道具 举报

11

主题

33

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
77
发表于 2005-8-22 23:33:00 | 显示全部楼层
请教第一个问题:定义这个struct point有什么意义。
在ObjectARX中或者用ads_point,或者用AcGePoint3d类(gepnt3d.h )、AcGePoint2d类(gepnt2d.h),有现成的东东最好拿来用,因为其比较完善。
而且有现成的转换函数(geassign.h ):
double * asDblArray(const AcGePoint3d& pnt);
AcGePoint2d & asPnt2d(const double* pnt);
AcGePoint3d & asPnt3d(const double* pnt);
第二,函数 inifk()中变量pMin没有定义。
回复

使用道具 举报

11

主题

33

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
77
发表于 2005-8-22 23:48:00 | 显示全部楼层

这两个函数的现实意义或你的设想?
回复

使用道具 举报

5

主题

6

帖子

1

银币

初来乍到

Rank: 1

铜币
26
发表于 2005-8-23 08:02:00 | 显示全部楼层
问题关键不在与 STRUCT POINT 关键在于acDocManager->sendStringToExecute(pDoc,strtmp,true,false,true);执行后,再执行FK(),结果是先执行FK(),不能够按原来的设计执行。
请高手联编执行一下。
inifk();目的就是先将当前绘图区设置好。fk()  当前绘图区选择部分区域。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-5 14:00 , Processed in 0.228031 second(s), 60 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表