回复
要在VC6.0下编译,在AutoCAD2000,2002下运行.我没有装VC6.0,
编译成功未必能运行,没有AutoCAD2002(2000)怎么测试结果呢? 我来帮你测试结果! 本帖最后由 作者 于 2004-11-13 14:52:25 编辑 <br /><br /> 王咣生发表于2004-11-12 12:13:00static/image/common/back.gif回复:(王咣生)回复为什么? 你自己为什么不编译? 还要我下载ObjectARX2000,再为你编译我提供给你的代码?
我这里没有AutoCAD2002.
<BR>我没有装VC6.0,
哪位大侠有时间帮zcsoft编译吧!
回复
创建文字样式的一段例子:static void setTextStyle_test(void)<BR> {<BR> // Add your code for command setTextStyle._test here<BR> Acad::ErrorStatus es;<BR> AcDbTextStyleTable *pTsTable;
es = curDoc()->database()->getSymbolTable(pTsTable,AcDb::kForRead);<BR> if (es != Acad::eOk)<BR> {<BR> AfxMessageBox("Couldn't get the text style table.");<BR> }
CString theFont = "宋体";
if (!pTsTable->has((LPTSTR)(LPCSTR)theFont))<BR> {<BR> AcDbTextStyleTableRecord *pStyle = new AcDbTextStyleTableRecord;
pStyle->setFont((LPTSTR)(LPCTSTR)theFont,Adesk::kFalse,Adesk::kFalse,0,34);<BR> pStyle->setFileName(theFont);<BR> pStyle->setBigFontFileName(theFont);
pStyle->setTextSize(8);<BR> pStyle->setXScale(2);<BR> pStyle->setObliquingAngle(0);<BR> pStyle->setName(theFont);<BR> pStyle->setIsShapeFile(Adesk::kFalse);<BR> pStyle->setIsVertical(Adesk::kFalse);
pTsTable->upgradeOpen();<BR> es = pTsTable->add(pStyle);<BR> if (es != Acad::eOk)<BR> {<BR> CString message;<BR> message.Format("%d",es);<BR> AfxMessageBox(message);<BR> }<BR> pStyle->close();<BR> }
<BR> // Get the style record we just created, to ensure that it was<BR> // added properly to the style table.<BR> AcDbObjectId styleId;
es = pTsTable->getAt(theFont,styleId);<BR> if (es != Acad::eOk)<BR> {<BR> CString message;<BR> message.Format("%d",es);<BR> AfxMessageBox(message);<BR> }<BR> else<BR> {<BR> AfxMessageBox("Got the style!");<BR> }
pTsTable->close();
AcDbText * text = new AcDbText(AcGePoint3d(10,10,0),"你好",styleId,10,0);<BR> AcDbBlockTable *pBlockTable;<BR> acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);<BR> AcDbBlockTableRecord *pBlockTableRecord;<BR> pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);<BR> pBlockTable->close();<BR> AcDbObjectId textId;<BR> es = pBlockTableRecord->appendAcDbEntity(textId,text);<BR> <BR> text->close();<BR> pBlockTableRecord->close();<BR> }
如图:
王斑竹,我原来用lisp现在想学ARX,本人严重支持你的论坛,希望能和你的论坛一起成长…… 最近没有做论坛,
想交流就到这里吧:
<A href="http://www.mjtd.com/bbs" target="_blank" >www.mjtd.com/bbs</A>
<A href="http://www.cadhelp.net/bbs" target="_blank" >www.cadhelp.net/bbs</A>
TabbedViews管理Drawings文档
TabbedViews管理Drawings文档:大哥能给我一份吗?
beetle_928@eyou.com 太可怕了,我要学习!!!!!!!!!!