I'm having trouble using acedDragGen to translate a custom AcDbEntity derived class.
My callback (scnf) function constructs a translation matrix and returns RTNORM.
I've also overridden subCloneMeForDragging and subHideMeForDragging to see if they are being called and I've found they are both being called (even if subCloneMeForDragging returns Adesk::kFalse). When I've coded them to return Adesk::kTrue and true, respectively, I've found that clone is called but and overridden subGetTransformedCopy isn't.
I've checked my overloads' signatures, a direct call to acedXformSS before acedDragGen will trigger my subTransformBy.
I'm guessing I'm missing something; most likely my initial assumption (that acedDragGen transforms its selection set using acedXformSS or similar) is wrong.
At the moment I'm looking for a solution that does not involve using global/static data (e.g. having a global pointer to my entity and calling transformBy inside scnf).
Any information as to what I'm doing wrong or any method to get the translation information from acedDragGen to my custom entity would be much appreciated.
ok, it is not possible to use an AcDbEntity derived Object with an ADS-Dragger without to install a Dragger Class derived from AcEdJig. I think there are many examples in the ObjectARx Samples.If you need more information post me, then I look for some examples.
But I think that the best what you can do is to implemented the Dragobject in your AcDbEntity Object. Look for dragStatus(), set a flag and draw in subWorldDraw whatever you want. It works. But I have to warn you because you have to implemeted two different ways (transformBy() and subMoveGripPointsAt(). One get a transformation vector, one get a transformation matrix.
Thanks for your reply, I've managed to find a solution myself.
The actual problem was subtle: my assumption (that acedDragGen transforms its selection set using acedXformSS or similar) was definetely wrong. The way it actually works is that it applies the transformation similar to pushModelTransform. It won't appear if you call getModelToWorldTransform; my best guess is that it gets cached and applied right before any drawing takes place, but it definetely gets applied.
What prevented me from seeing this was the fact that I was using worldLine to draw a mesh representation of my object and this function is unaffected by the transform stack or the tracking callback (scnf).
It took a simple fix (using polyline instead of worldLine) and everything worked out fine.
Hope this helps someone!
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register