struct resbuf 结构就象LISP里面的表(
struct resbuf 结构就象LISP里面的表((LISP a b)(LISP a b)(LISP a b)(LISP a b).....) 之类的东东,主要是用来做一个对象的DXF组码链表,然后用来给别的涵数生成对象之类的处理,如果是生成对象的话我们可以不用struct resbuf结构来做,直用用对象类来生成啊.例如:
LISP用DXF组码生成一个圆的代码:
(setq Cirlist ‘((0 . "CIRCLE")(100 . "AcDbEntity")(100 . "AcDbCircle")(8 . "0")(40 . 0.8) (10 0 0 0)))
(entmake Cirlist)
ARX用struct resbuf 生成一个圆的代码:
struct resbuf *Cirlist;
ads_point PT1={0,0,0};
Cirlist=acutBuildList(RTDXF0,"CIRCLE",100,"AcDbEntity",100,"AcDbCircle",8,"0",40,0.8,10,PT1,0);
acdbEntMake(Cirlist);
用ARX的类生成一个圆的代码:
ads_real rad=3.0;
AcGePoint3d Cpt(0,0,0);
AcGeVector3d Vec(0,0,1);
AcDbCircle *nc=new AcDbCircle();
nc->setCenter(Cpt);
nc->setRadius(rad);
AcDbBlockTable *btable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(btable,AcDb::kForRead);
AcDbBlockTableRecord *brecord;
btable->getAt(ACDB_MODEL_SPACE,brecord,AcDb::kForWrite);
brecord->appendAcDbEntity(nc);
nc->close();
btable->close();
brecord->close();