cancel
Showing results for 
Search instead for 
Did you mean: 

Highlight Callbacks / Notification?

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hi,

 

Is there any way to get a callback or some other notification when an object is highlighted in the graphics window?  

 

Thanks,

Victor

4 REPLIES

Re: Highlight Callbacks / Notification?

Pioneer
Pioneer

Hi

 

You can use Selection Subscriber or Context menu to get call backs when any object is selected. 

 

These methods will not give you the callback in case of hovering over the mouse over the object. But if the object is selected then it works fine.

 

Thanks

Gunjeet

Re: Highlight Callbacks / Notification?

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hi Gunjeet,

 

Thanks for the reply.  Selection Subscriber sounds like what I need, however, it looks like it was added in NX11.  I need to implement in NX 8.5, 9.0.1, 10.0, and 11.0.

 

Can you elaborate on Context Menu?  I don't quite see from the Help Docs how I can apply it to our situation. 

 

Thanks,

Victor

Re: Highlight Callbacks / Notification?

Pioneer
Pioneer

Hi

 

Just register a callback using the Below Code:-

MyConctextMenuID = theUI.MenuBarManager.RegisterConfigureContextMenuCallback("menuName","Context Menu Name", new MenuBarManager.ConfigureContextMenu(methodName));

 

On the Method you will get callbacks when User RightClicks on any object whether from part navigator or Graphical Window.

 

Hope This will help.

 

Thanks

Gunjeet

Re: Highlight Callbacks / Notification?

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Thanks Gunjeet,

 

When I apply the code mentioned, I get an error that I can't make sense of (see below).  

 

I'm using C++ in VS2012

 

1>libug\ug_callbacks.cpp(175): error C2259: 'NXOpen::Callback2<Result,Arg1,Arg2>' : cannot instantiate abstract class

1> with
1> [
1> Result=int,
1> Arg1=NXOpen::MenuBar::ContextMenu *,
1> Arg2=NXOpen::MenuBar::ContextMenuProperties *
1> ]
1> due to following members:
1> 'NXOpen::BaseCallback *NXOpen::BaseCallback::Clone(void) const' : is abstract
1> D:\3DCS_UG_HOME_DIR\e_ugopen_nx\include\NXOpen/Callback.hxx(29) : see declaration of 'NXOpen::BaseCallback::Clone'
1> 'bool NXOpen::BaseCallback::Equals(const NXOpen::BaseCallback &) const' : is abstract
1> D:\3DCS_UG_HOME_DIR\e_ugopen_nx\include\NXOpen/Callback.hxx(31) : see declaration of 'NXOpen::BaseCallback::Equals'
1> 'int NXOpen::Callback2<Result,Arg1,Arg2>:Smiley Surprisedperator ()(Arg1,Arg2) const' : is abstract
1> with
1> [
1> Result=int,
1> Arg1=NXOpen::MenuBar::ContextMenu *,
1> Arg2=NXOpen::MenuBar::ContextMenuProperties *
1> ]

 

Any idea?