AutoCAD2010二次开发,自定直线时出错
这个是添加的代码AcGePoint3d ptStart(0,0,0);
AcGePoint3d ptEnd(200,200,0);
AcDbLine*pline=new AcDbLine(ptStart,ptEnd);
AcDBlockTable*pBlockTable;
acdbHostApplicationServices()->workingDatabase()
->getBlockTable(pBlockTableRecord,AcDb::kForRead);
AcDbBlockTableRecord*pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord);
AcDb::kForWrite);
AxDbObjectId lineId;
pBlockTableRecord->appendAcDbEntity(lineId,pLine);
pBlockTable->close();
PBlockTableRecord->close();
pLine->close();
编译时是不是要添加头文件,怎样添加
编译时出现很多错误
1>e:\objecarx2010mulu\mydraw\mydraw\acrxentrypoint.cpp(77) : error C2059: 语法错误 : “)”
1>e:\objecarx2010mulu\mydraw\mydraw\acrxentrypoint.cpp(78) : error C2146: 语法错误 : 缺少“;”(在标识符“lineId”的前面)
1>e:\objecarx2010mulu\mydraw\mydraw\acrxentrypoint.cpp(78) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\objecarx2010mulu\mydraw\mydraw\acrxentrypoint.cpp(78) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\objecarx2010mulu\mydraw\mydraw\acrxentrypoint.cpp(79) : error C2143: 语法错误 : 缺少“;”(在“->”的前面)
http://bbs.mjtd.com/xwb/images/bgimg/icon_logo.png 该贴已经同步到 damingming0073的微博 添加什么头文件?
编检查编译器定位的结果看看
再不行屏蔽这段代码看看 风树 发表于 2014-7-14 17:12 static/image/common/back.gif
添加什么头文件?
编检查编译器定位的结果看看
再不行屏蔽这段代码看看
由于使用了AcDbLine 所以要添加dbent.h
风树 发表于 2014-7-14 17:12 static/image/common/back.gif
添加什么头文件?
编检查编译器定位的结果看看
再不行屏蔽这段代码看看
这段代码就是来生成直线的啊. 如果屏蔽了,怎么生成呢 damingming0073 发表于 2014-7-15 09:19 static/image/common/back.gif
这段代码就是来生成直线的啊. 如果屏蔽了,怎么生成呢
什么问题?解决好了吗?分享一下吧 AcDbBlockTableRecord*pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord);
AcDb::kForWrite);
改一下AcDbBlockTableRecord*pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord
AcDb::kForWrite); a335805186 发表于 2014-7-16 19:17 static/image/common/back.gif
AcDbBlockTableRecord*pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBloc ...
真相帝 a335805186 发表于 2014-7-16 19:17 static/image/common/back.gif
AcDbBlockTableRecord*pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBloc ...
不好意思,我在提问的时候写错了,改成你说的还是那么多错误我添加了dbents.h 提示这样的错误什么意思呢?
1>d:\objectarx开发包\objectarx2010\inc\acarray.h(137) : error C2857: 在源文件中没有找到用 /YcStdAfx.h dbents.h 命令行选项指定的“#include”语句
风树 发表于 2014-7-16 20:09 static/image/common/back.gif
真相帝
改成这样你成功了吗 AcGePoint3d ptStart(0,0,0);
AcGePoint3d ptEnd(200,200,0);
AcDbLine*pline=new AcDbLine(ptStart,ptEnd);
AcDbBlockTable*pBlockTable;
AcDbBlockTableRecord*pBlockTableRecord;
acdbHostApplicationServices()->workingDatabase()
->getBlockTable(pBlockTable,AcDb::kForRead);
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
AcDb::kForWrite);
AcDbObjectId lineId;
pBlockTableRecord->appendAcDbEntity(lineId,pline);
pBlockTable->close();
pBlockTableRecord->close();
pline->close();
页:
[1]
2