乐筑天下

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

关于数据定义的问题

[复制链接]

19

主题

47

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
123
发表于 2004-10-29 10:38:00 | 显示全部楼层 |阅读模式
我在程序中定义了一点数组ADS_POINT SS[20],然后给这个数组赋值,ADS_POINT_SET(SS[i],POINT1),请问这样可以吗??编译能通过,可是在CAD下运行总得不到想要的结果,有时还导致CAD崩溃,麻烦了!急,谢
回复

使用道具 举报

124

主题

837

帖子

9

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1333
发表于 2004-10-29 10:56:00 | 显示全部楼层
AutoCAD points are defined as the following array type:
typedef ads_real ads_point[3];
A point always includes three values. If the point is two-dimensional, the third element of the array can be ignored; it is safest to initialize it to 0. 不可以
回复

使用道具 举报

14

主题

202

帖子

4

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
258
发表于 2004-10-29 10:56:00 | 显示全部楼层
#define ads_point_set(from, to) (*(to)= *(from), (to)[1]=(from)[1], (to)[2]=(from)[2])
你把 你的使用代码贴出来看看
回复

使用道具 举报

19

主题

47

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
123
发表于 2004-10-29 15:54:00 | 显示全部楼层
我的意思是可以定义点数组吗??象这样:ADS_POINT SS[20]
回复

使用道具 举报

14

主题

202

帖子

4

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
258
发表于 2004-10-29 16:02:00 | 显示全部楼层
可以
回复

使用道具 举报

19

主题

47

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
123
发表于 2004-10-29 16:06:00 | 显示全部楼层
ads_name pipe[100];////////管段的数组
ads_point as_point[200],ae_point[200];///////管段起始节点的数组
ads_point totalpoint[200];
for(int i=0;i<len1;i++)
{acedSSName(sspipe,i,pipe[i]);
line_data(pipe[i],as_point[i],ae_point[i]);
as_point[i][X]=totalpoint[2*i][X];
as_point[i][Y]=totalpoint[2*i][Y];
as_point[i][Z]=totalpoint[2*i][Z];
ae_point[i][X]=totalpoint[2*i+1][X];
ae_point[i][Y]=totalpoint[2*i+1][Y];
ae_point[i][Z]=totalpoint[2*i+1][Z];
}代码如上,编译通过了.可在CAD下运行总是不可以,为什么呢??其实我就是想定义点数组,怎么解决这问题呢??急
回复

使用道具 举报

34

主题

372

帖子

7

银币

中流砥柱

Rank: 25

铜币
508
发表于 2004-10-30 10:02:00 | 显示全部楼层
你跟踪调试一下,说不定问题不在这里。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-2-5 00:45 , Processed in 0.633402 second(s), 66 queries .

© 2020-2025 乐筑天下

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