ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using acedDragGen with AcDbEntity derived class

2 REPLIES 2
Reply
Message 1 of 3
Garthenius
684 Views, 2 Replies

Using acedDragGen with AcDbEntity derived class

Hi,

 

I'm having trouble using acedDragGen to translate a custom AcDbEntity derived class.

 

  • The assumption I've made is that acedDragGen transforms its selection set using acedXformSS (or in a similar) ;

 

  • My solution was to implement subTransformBy in my custom class;

 

  • The problem is that subTransformBy is not getting called.

 

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.

2 REPLIES 2
Message 2 of 3
TomBengsch
in reply to: Garthenius

Dear Garthenius,

 

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.

Message 3 of 3
Garthenius
in reply to: Garthenius

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!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost