ObjectARX

ObjectARX

Reply
Distinguished Contributor
maisoui
Posts: 142
Registered: ‎12-07-2009
Message 1 of 5 (380 Views)
Accepted Solution

How replicate PLINE grip menu on my custom entity?

380 Views, 4 Replies
02-04-2013 11:41 PM

Hi,

 

I'd like to replicate the PLINE grip menu on my custom entity : when grip is hovered, a menu is displayed (actions = Stretch Vertex, Add Vertex, Remove Vertex).

 

gripmenu.png

 

For now, I can display a context menu by:

  1. creating a AcDbGripData (in subMoveGripPointsAt method)
  2. Specifying a custom GripOperation (function ptr) for hover
  3. Creating a CMenu in my custom GripOperation function
  4. Displaying my menu like this : 
    BOOL result = pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, p.x + 15, p.y + 20, AfxGetMainWnd());
    (where p is a POINT representing the current cursor location)

I don't know if this is the right way because the point of the grip is blue (as if it was warm), while for the PLINE it becomes orange (see the image above).

And I like to know how to begin move grip process? The PLINE menu launches the command GRIP_STRETCH. I tried to use the same command but I was unable to execute it with:

 

acedCommand(RTSTR, _T("_.grip_stretch"), RTENAME, pickSet, RTNONE);

 

Maybe someone can provide an example? All suggestions are welcomed.

 

Regards,

Jonathan

 

--
Jonathan

Check out the class AcDbMultiModesGripPE class in dbMultiModesGrip.h in the ObjectARX SDK

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 5 (357 Views)

Re: How replicate PLINE grip menu on my custom entity?

02-11-2013 05:50 PM in reply to: maisoui

Check out the class AcDbMultiModesGripPE class in dbMultiModesGrip.h in the ObjectARX SDK





Fenton Webb

Developer Technical Services

Autodesk Developer Network


Distinguished Contributor
maisoui
Posts: 142
Registered: ‎12-07-2009
Message 3 of 5 (342 Views)

Re: How replicate PLINE grip menu on my custom entity?

02-12-2013 12:44 AM in reply to: fenton.webb

Thank you for your answer. It could be a good solution, but I'm using OARX 2010 and I guess AcDbMultiModesGripPE appeared in OARX 2012 or 2013. Is there another solution or it's only a new feature of next OARX?

--
Jonathan
ADN Support Specialist
Balaji_Ram
Posts: 735
Registered: ‎03-21-2011
Message 4 of 5 (324 Views)

Re: How replicate PLINE grip menu on my custom entity?

02-14-2013 07:05 AM in reply to: maisoui

Hello,

 

The API for multi-functional grips was introduced in ObjectARX 2012 although AutoCAD had it as a feature in 2011.

Sorry, there is no way to get it using 2010 SDK.



Balaji
Developer Technical Services
Autodesk Developer Network

Distinguished Contributor
maisoui
Posts: 142
Registered: ‎12-07-2009
Message 5 of 5 (322 Views)

Re: How replicate PLINE grip menu on my custom entity?

02-14-2013 07:07 AM in reply to: Balaji_Ram

Ok. Thank you for your anwser. I was able to reproduce this feature with a little time and perseverance.

Regards,

Jonathan

 

--
Jonathan
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!