Problem in inheriting AcDbSurface in DBX project

Problem in inheriting AcDbSurface in DBX project

Anonymous
Not applicable
1,675 Views
7 Replies
Message 1 of 8

Problem in inheriting AcDbSurface in DBX project

Anonymous
Not applicable

Cann't we inherit AcDbSurface to derive my custom object? When my class inherit AcDbSurface or AcDbNurbsSurface, I got several error LNK2001 messages, such as "AcDbSurface::createInterferenceObjects". After I tried linking every lib provided, I still cann't compile the project.

Then I tried to inherit AcDbEntity to derive a custom object, but when AcDbSurface/AcDbNurbsSurface is instantiated as a member variable, the error LNK2001 errors show up again. So the second question is, is the AcDbSurface unavailable in DBX project?

 

 

0 Likes
Accepted solutions (3)
1,676 Views
7 Replies
Replies (7)
Message 2 of 8

moogalm
Autodesk Support
Autodesk Support

Applications should not derive classes from the following:

  • AcDbDimension
  • AcDbSymbolTable, AcDbSymbolTableRecord, and all classes derived from them
  • AcDbBlockBegin
  • AcDbBlockEnd
  • AcDbSequenceEnd
  • AcDbSequenceEnd
  • AcDb2dPolyline
  • AcDb2dVertex
  • AcDb3dPolyline
  • AcDb3dPolylineVertex
  • AcDbPolygonMesh
  • AcDbPolygonMeshVertex
  • AcDbPolyFaceMesh
  • AcDbPolyFaceMeshVertex
  • AcDbFaceRecord
  • AcDbMInsertBlock
  • AcDbVertex

Apart from above list, deriving from AcDbSurface should be doable, these are some derived class

  • AcDbExtrudedSurface
  • AcDbLoftedSurface
  • AcDbPlaneSurface
  • AcDbRevolvedSurface
  • AcDbSweptSurface

Which version of AutoCAD you are using ?, if it is AutoCAD 2021, you may need to link acgeomEnt.lib, and also you need to load AcGeomEntObj.dbx

Message 3 of 8

Anonymous
Not applicable

Thanks for your answering. Then how can I derive from the AcDbNurbSurface? I'm using ObjectArx 2021, and I created a DBX project using the arx wizard, and derived a custom object from AcDbEntity using the "ArxWizCustomObject" wizard in VS 2019 (because there is no AcDbNurbSurface, nor AcDbSurface in the opition of the wizard). Then I modified the codes generated manually to inherit AcDbNurbSurface. 

#pragma comment(lib, "acgeomEnt.lib") is used to link acgeomEnt.lib. And I got the following link error

1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::createInterferenceObjects(class AcArray<class AcDbEntity *,class AcArrayMemCopyReallocator<class AcDbEntity *> > &,class AcDbEntity *,unsigned int)const " (?createInterferenceObjects@AcDbSurface@@UEBA?AW4ErrorStatus@Acad@@AEAV?$AcArray@PEAVAcDbEntity@@V?$AcArrayMemCopyReallocator@PEAVAcDbEntity@@@@@@PEAVAcDbEntity@@I@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::booleanUnion(class AcDbSurface const *,class AcDbSurface * &)" (?booleanUnion@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEBV1@AEAPEAV1@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::booleanSubtract(class AcDbSurface const *,class AcDbSurface * &)" (?booleanSubtract@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEBV1@AEAPEAV1@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::booleanSubtract(class AcDb3dSolid const *,class AcDbSurface * &)" (?booleanSubtract@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEBVAcDb3dSolid@@AEAPEAV1@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::booleanIntersect(class AcDbSurface const *,class AcArray<class AcDbEntity *,class AcArrayMemCopyReallocator<class AcDbEntity *> > &)" (?booleanIntersect@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEBV1@AEAV?$AcArray@PEAVAcDbEntity@@V?$AcArrayMemCopyReallocator@PEAVAcDbEntity@@@@@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::booleanIntersect(class AcDb3dSolid const *,class AcArray<class AcDbEntity *,class AcArrayMemCopyReallocator<class AcDbEntity *> > &)" (?booleanIntersect@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEBVAcDb3dSolid@@AEAV?$AcArray@PEAVAcDbEntity@@V?$AcArrayMemCopyReallocator@PEAVAcDbEntity@@@@@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::imprintEntity(class AcDbEntity const *)" (?imprintEntity@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEBVAcDbEntity@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::createSectionObjects(class AcGePlane const &,class AcArray<class AcDbEntity *,class AcArrayMemCopyReallocator<class AcDbEntity *> > &)const " (?createSectionObjects@AcDbSurface@@UEBA?AW4ErrorStatus@Acad@@AEBVAcGePlane@@AEAV?$AcArray@PEAVAcDbEntity@@V?$AcArrayMemCopyReallocator@PEAVAcDbEntity@@@@@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::sliceByPlane(class AcGePlane const &,class AcDbSurface * &,class AcDbSurface * &)" (?sliceByPlane@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@AEBVAcGePlane@@AEAPEAV1@1@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::sliceBySurface(class AcDbSurface const *,class AcDbSurface * &,class AcDbSurface * &)" (?sliceBySurface@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEBV1@AEAPEAV1@1@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::chamferEdges(class AcArray<class AcDbSubentId *,class AcArrayMemCopyReallocator<class AcDbSubentId *> > const &,class AcDbSubentId const &,double,double)" (?chamferEdges@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@AEBV?$AcArray@PEAVAcDbSubentId@@V?$AcArrayMemCopyReallocator@PEAVAcDbSubentId@@@@@@AEBVAcDbSubentId@@NN@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::filletEdges(class AcArray<class AcDbSubentId *,class AcArrayMemCopyReallocator<class AcDbSubentId *> > const &,class AcArray<double,class AcArrayMemCopyReallocator<double> > const &,class AcArray<double,class AcArrayMemCopyReallocator<double> > const &,class AcArray<double,class AcArrayMemCopyReallocator<double> > const &)" (?filletEdges@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@AEBV?$AcArray@PEAVAcDbSubentId@@V?$AcArrayMemCopyReallocator@PEAVAcDbSubentId@@@@@@AEBV?$AcArray@NV?$AcArrayMemCopyReallocator@N@@@@11@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::setSubentColor(class AcDbSubentId const &,class AcCmColor const &)" (?setSubentColor@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@AEBVAcDbSubentId@@AEBVAcCmColor@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::getSubentColor(class AcDbSubentId const &,class AcCmColor &)const " (?getSubentColor@AcDbSurface@@UEBA?AW4ErrorStatus@Acad@@AEBVAcDbSubentId@@AEAVAcCmColor@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::setSubentMaterial(class AcDbSubentId const &,class AcDbObjectId const &)" (?setSubentMaterial@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@AEBVAcDbSubentId@@AEBVAcDbObjectId@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::getSubentMaterial(class AcDbSubentId const &,class AcDbObjectId &)const " (?getSubentMaterial@AcDbSurface@@UEBA?AW4ErrorStatus@Acad@@AEBVAcDbSubentId@@AEAVAcDbObjectId@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::setSubentMaterialMapper(class AcDbSubentId const &,class AcGiMapper const &)" (?setSubentMaterialMapper@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@AEBVAcDbSubentId@@AEBVAcGiMapper@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::getSubentMaterialMapper(class AcDbSubentId const &,class AcGiMapper &)const " (?getSubentMaterialMapper@AcDbSurface@@UEBA?AW4ErrorStatus@Acad@@AEBVAcDbSubentId@@AEAVAcGiMapper@@@Z)
1>igaShell.obj : error LNK2019: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::dwgInFields(class AcDbDwgFiler *)" (?dwgInFields@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEAVAcDbDwgFiler@@@Z),函数 "public: virtual enum Acad::ErrorStatus __cdecl igaShell::dwgInFields(class AcDbDwgFiler *)" (?dwgInFields@igaShell@@UEAA?AW4ErrorStatus@Acad@@PEAVAcDbDwgFiler@@@Z) 中引用了该符号
1>igaShell.obj : error LNK2019: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::dwgOutFields(class AcDbDwgFiler *)const " (?dwgOutFields@AcDbSurface@@UEBA?AW4ErrorStatus@Acad@@PEAVAcDbDwgFiler@@@Z),函数 "public: virtual enum Acad::ErrorStatus __cdecl igaShell::dwgOutFields(class AcDbDwgFiler *)const " (?dwgOutFields@igaShell@@UEBA?AW4ErrorStatus@Acad@@PEAVAcDbDwgFiler@@@Z) 中引用了该符号
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::dxfInFields(class AcDbDxfFiler *)" (?dxfInFields@AcDbSurface@@UEAA?AW4ErrorStatus@Acad@@PEAVAcDbDxfFiler@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::dxfOutFields(class AcDbDxfFiler *)const " (?dxfOutFields@AcDbSurface@@UEBA?AW4ErrorStatus@Acad@@PEAVAcDbDxfFiler@@@Z)
1>igaShell.obj : error LNK2001: unresolved external symbol "public: virtual enum Acad::ErrorStatus __cdecl AcDbSurface::getPlane(class AcGePlane &,enum AcDb::Planarity &)const " (?getPlane@AcDbSurface@@UEBA?AW4ErrorStatus@Acad@@AEAVAcGePlane@@AEAW4Planarity@AcDb@@@Z)

The header and cpp files of the custom object are attached blow.

0 Likes
Message 4 of 8

moogalm
Autodesk Support
Autodesk Support
Accepted solution

Hi,

I initially believe it is case in AutoCAD 2021,

But going back to previous release, deriving from AcDbSurface never possible, we didn't push the relevant libraries to public SDK.

 

I will get back to you on this.

 

Message 5 of 8

moogalm
Autodesk Support
Autodesk Support
Accepted solution

Thanks I raised a Documentation ticket with Help and Learning team.

Message 6 of 8

Anonymous
Not applicable

Thanks a lot. You mean it's a bug? Please inform me when it's fixed 😘

0 Likes
Message 7 of 8

moogalm
Autodesk Support
Autodesk Support
Accepted solution

No, I don't mean it is bug 😊, after investigating I realized AcDbSurface was never designed to be inheritable, it is just this piece is missing in our documentation, next time when a developer would like to create a custom entity they can always check  this link what Entities can be derived and not.

 

Message 8 of 8

Anonymous
Not applicable

OK, looks like I have to find an alternative solution. Thanks all the same.

0 Likes