
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, i'm trying to create a custom ObjectARX entity to help me in my job and i'm facing some problems. Since i wont share my custom entity with our costumers i'm creating it with ObjectARX instead ObjectDBX. First off, that is the code i got so far, a simple basic entity (.cpp file 😞
Duto::Duto () : AcDbEntity (), mCenter(100.0, 100.0, 0.0) { } Duto::~Duto () { }
Adesk::Boolean Duto::subWorldDraw (AcGiWorldDraw *mode) { assertReadEnabled () ; mode->geometry().circle(mCenter, 50.0, AcGeVector3d(0.0, 0.0, 1.0)); return Adesk::kTrue; } Acad::ErrorStatus Duto::subGetGripPoints ( AcGePoint3dArray &gripPoints, AcDbIntArray &osnapModes, AcDbIntArray &geomIds ) const { assertReadEnabled() ; gripPoints.append(mCenter); return Acad::eOk; } Acad::ErrorStatus Duto::subMoveGripPointsAt (const AcDbIntArray &indices, const AcGeVector3d &offset) { assertWriteEnabled (); mCenter += offset; return Acad::eOk; } Acad::ErrorStatus Duto::subTransformBy(const AcGeMatrix3d &xfm) { assertWriteEnabled(); mCenter.transformBy(xfm); return ( AcDbEntity::subTransformBy(xfm)); }
That is the first weird thing, look this video:
https://www.youtube.com/watch?v=fRAeMQLaeL0
When i move/stretch/drag the circle the peview apears in the wrong place. The final position is right though.
Another problem is i can't select my entity with ssget:
(ssget "x" '((0 . "Duto")))
But when i use the Autolisp command
(entget (car (entsel)))
and select my entity, i get this: "... (100 . "Duto") ...".
I did rename the entity .cpp file as a .lsp file in order to put it in the attachments.
I'm using Autocad2012/ObjectARX 2012/VS 2010. That's all, thanks in advance and sorry my english.
Solved! Go to Solution.