gdc666 发表于 2003-5-4 15:31:00

问一个关于acedcmd()函数的问题

是这样的,我现在有一个ads_point的二维数组30×30,里面装了900个点,现在我想用3dmesh命令将这900个点构成一个网格曲面,因为3dmesh命令必须要把每一个网格点的坐标选定,显然如果手工选点的话实在太麻烦了,用acedCommand()函数显然也是不行的,于是就只剩下acedCmd()了,因为acedCmd()的参数是一个结果缓冲区链表,于是我如下试验构造了一个只有四个点的结果缓冲区链表,但是老成功不了,自己找不到原因,希望大侠帮忙

struct resbuf eb0,eb1,eb2,eb3,eb4,eb5,eb6;
   char seb0;
   strcpy(seb0,"3dmesh");
   ads_point p1,p2,p3,p4;
   p1=1;p1=1;p1=0;
   p2=0;p2=1;p2=0;
   p3=1;p3=0;p3=0;
   p4=0;p4=0;p4=0;
   eb0.restype=RTSTR;
   eb1.restype=RT3DPOINT;
   eb2.restype=RT3DPOINT;
   eb3.restype=RT3DPOINT;
   eb4.restype=RT3DPOINT;
   eb5.restype=RTSHORT;
   eb6.restype=RTSHORT;

   eb0.resval.rstring=seb0;
   eb1.resval.rpoint=p1,p1,p1;
   eb2.resval.rpoint=p2,p2,p2;
   eb3.resval.rpoint=p3,p3,p3;
   eb4.resval.rpoint=p4,p4,p4;
   eb5.resval.rint=2;
   eb6.resval.rint=2;

   eb0.rbnext=&eb5;
   eb5.rbnext=&eb6;
   eb6.rbnext=&eb1;
   eb1.rbnext=&eb2;
   eb2.rbnext=&eb3;
   eb3.rbnext=&eb4;
   eb4.rbnext=NULL;
acedCmd(&e0);//

arbyao 发表于 2003-5-11 11:30:00

你应该这样做

你应该这样做
cmdlist = acutBuildList(RTSTR, "._3dmesh",                                               RT3DPOINT, p1,
               RT3DPOINT, p2,
               RT3DPOINT, p3,
               RT3DPOINT, p4,
RTSTR, "", 0);
acedCmd(cmdlist);
页: [1]
查看完整版本: 问一个关于acedcmd()函数的问题