BDYCAD 发表于 2007-6-3 13:33:00

<p>转自: <a href="http://bbs.caddev.cn/dispbbs.asp?boardID=5&amp;ID=2&amp;page=1">http://bbs.caddev.cn/dispbbs.asp?boardID=5&amp;ID=2&amp;page=1</a></p><p>(一)&nbsp;&nbsp; ObjectARX 2002 + AutoCAD 2002 + VC6.0 + Assist 6.0 + VSS 6.0C</p><p>配置文件:rxapi.lib acrx15.lib acdb15.lib acutil15.lib acge15.lib acgiapi.lib achapi15.lib acISMobj15.lib acad.lib </p><p>acedapi.lib acsiobj.lib adui15.lib acui15.lib (GeomathD.lib或者./../GeomathD.lib 或者./../GeoCadBase/GeomathD.lib ) </p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 比较经典的组合。</p><p>(二)&nbsp;&nbsp; ObjectARX 2004/2005 + AutoCAD 2004/2005 + VC.Net 2002 </p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectARX2006 + AutoCAD2006 + VC.NET2002</p><p>配置文件:rxapi.lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acdb16.lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acge16.lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acad.lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acedapi.lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acui16.lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; adui16.lib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p><p>achapi16.lib</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 目前较稳定的组合。</p><p>(三)&nbsp;&nbsp; ObjectARX 2005 + AutoCAD 2004/2005 + VC.Net 2003</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 需调用或验证大量VC7.0的库,否则编译不过。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 解决方案:拷贝VC2002安装目录下/VC7\atlmfc\lib下 70 的文件到VC2003下,主要有:<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mfc70.lib、&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mfc70d.lib、mfc70u.lib、mfc70ud.lib</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mfcs70.lib、mfcs70.pdb、mfcs70d.lib、mfcs70d.pdb </p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mfcs70u.lib、mfcs70u.pdb、mfcs70ud.lib、mfcs70ud.pdb</p><p>(四)&nbsp;&nbsp; ObjectARX 2006 + AutoCAD 2006 + VC.Net 2003 + Assist X + VSS 6.0D</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 同样需要VC7.0的库。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 简要方法:(1) 复制VC2003的相关库文件如:mfc71.lib、mfcs71.lib并改名为 70 的文件如:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mfc70.lib、</p><p>mfcs70.lib。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2) 拷贝VC2002的相关库文件到VC2003的对应安装目录下。</p><p>(五)&nbsp;&nbsp; ObjectARX 2006 + AutoCAD 2006 + V#.Net 2003</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Net ARX编程组合。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 编译的程序文件名为.dll,在AutoCAD中的加载命令为:NetLoad,但没有缷载命令,只有关闭AutoCAD。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 调用ARX函数时using 相关命名空间,类似VC里include头文件。</p><p>(六)&nbsp;&nbsp; ObjectARX 2007 + AutoCAD 2007 + VC.Net 2005 +Visual Assist v10.2.1442.0 + Visual SourceSafe 2005</p>

BDYCAD 发表于 2007-6-5 18:41:00

给LISP调用的画圆子程序
static int ads_createcircle(void)
{
//----- Remove the following line if you do not expect any argument for this ADS function
struct resbuf *pArgs =acedGetArgs () ,*n1;
// TODO: add your code here
ads_point pt1;
ads_real inrad;
pt1=pArgs->resval.rpoint;
pt1=pArgs->resval.rpoint;
pt1=0;
n1=pArgs->rbnext;
inrad=n1->resval.rreal;
AcDbCircle *nc=new AcDbCircle();
AcGePoint3d cpt=asPnt3d(pt1);
nc->setCenter(cpt);
nc->setRadius(inrad);
AcDbBlockTable *blocktable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(blocktable,AcDb::kForRead);
AcDbBlockTableRecord *blocktablerecord;
blocktable->getAt(ACDB_MODEL_SPACE,blocktablerecord,AcDb::kForWrite);
AcDbObjectId cirid;
blocktablerecord->appendAcDbEntity(cirid,nc);
blocktable->close();
blocktablerecord->close();
nc->close();
acedRetVoid () ;
return (RSRSLT) ;
}

BDYCAD 发表于 2007-6-9 10:21:00

// ----- ads_drawfristars command
//编写:BDYCAD;
//时间:2007-06-09
//加载后在LISP里面这样调用(drawfristars(GETPOINT)20.0)进行画五角星
static int ads_drawfristars(void)
{
//----- Remove the following line if you do not expect any argument for this ADS function
struct resbuf *pArgs =acedGetArgs (),*n1;
// TODO: add your code here
ads_point cpt,pt1,pt2;
int co1;
ads_real inrad,pi,ang1,pi5;
pi=3.14159;
ang1=pi/2.0;
pi5=pi*2.0/5;
co1=5;
const int co2=co1-1;
double pointlist;
cpt=pArgs->resval.rpoint;
cpt=pArgs->resval.rpoint;
cpt=0;
n1=pArgs->rbnext;
inrad=n1->resval.rreal;
for (int i=0;5>i;i++) {
   acutPolar(cpt,ang1,inrad,pt1);
   pointlist=pt1;
   pointlist=pt1;
   pointlist=pt1;
   //AcGePoint3d cpt=asPnt3d(pt1);
   //bdyads_createcircle(cpt,1.0);
   ang1=ang1+pi5;
}
int b;
for (int i=0;5>i;i++) {
   b=i+2;
   if (i==4){
    b=1;
   }
   if (b==5) {
    b=0;
   }
   pt1=pointlist;
   pt1=pointlist;
   pt1=pointlist;
   pt2=pointlist;
   pt2=pointlist;
   pt2=pointlist;
   bdyads_createline(cpt,pt1);
   bdyads_createline(pt1,pt2);
}
// TODO: Replace the following line by your returned value if any
acedRetVoid () ;
return (RSRSLT) ;
}
static AcDbObjectId bdyads_createline(ads_point spt,ads_point ept)
{
AcGePoint3d pt1=asPnt3d(spt), pt2=asPnt3d(ept);
AcDbLine *nl=new AcDbLine;
nl->setStartPoint(pt1);
nl->setEndPoint(pt2);
AcDbBlockTable *blocktable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(blocktable,AcDb::kForRead);
AcDbBlockTableRecord *blocktablerecord;
blocktable->getAt(ACDB_MODEL_SPACE,blocktablerecord,AcDb::kForWrite);
AcDbObjectId lineid;
blocktablerecord->appendAcDbEntity(lineid,nl);
blocktable->close();
blocktablerecord->close();
nl->close();
return lineid;
}

BDYCAD 发表于 2007-6-9 13:49:00

<p>第13楼和14楼是2007-06-09日学习ARX编写一个画星星[五角星]的ARX程序,第13楼的代码是生成由LISP调用的ARX程序代码。</p><p>现在上传的是制作成命令使用的程序代码和程序编写教程序还有该程序的源码,上传到这里给大家做个交流,还望各位朋友多多指点:)</p>

BDYCAD 发表于 2007-7-8 11:15:00

本帖最后由 作者 于 2007-7-8 11:38:04 编辑 <br /><br /> <p></p><p>根据nameld001朋友的要求我们用ARX写一段画PLINE的程序MAKE方法:)代码如下:</p><p><br/>//时间:2007-07-08<br/>struct resbuf* re;<br/>ads_point pt1={10,10,0};<br/>ads_point pt2 ={20,20,0};<br/>re=acutBuildList(RTDXF0,"lwpolyline",100,"AcDbEntity",100,"AcDbPolyline",<br/>&nbsp;&nbsp;&nbsp;&nbsp; 90,2,10,pt1,10,pt2,70,0,0);<br/>acdbEntMake(re);</p>

lsl8753 发表于 2007-7-13 12:50:00

jy00517793 发表于 2007-7-16 16:50:00

真是好心人呀,VS2003+arx2006也能这样做吗?

BDYCAD 发表于 2007-7-17 09:17:00

要VS2002+arx2006+AutoCAD R2004~2006的

gis-liang 发表于 2007-7-17 22:13:00

<p>版主同志:你能否给我一些struct resbuf方面的资料,对这个东西比较模糊,不知道有什么用处。</p>

gis-liang 发表于 2007-7-17 22:14:00

我的邮箱:liangdongfeng2003@yahoo.com.cn
页: 1 [2] 3 4 5 6
查看完整版本: 学习ARX,编个初组的命令,呵呵