Skip to main content
12-Amethyst
January 11, 2022
Solved

Add Jlink to right click menu in model tree

  • January 11, 2022
  • 2 replies
  • 2492 views

In assembly mode I have added a Jlink app to select then you right click on a part.

Can I send the part name to this Jlink, so I can let Jlink work with this part?

 

akok_0-1641903235786.png

 

Best answer by sjuraj

When you have something selected it is in SelectionBuffer so you can retrieve anything you like from it. If you have selected component you can directly access whole model not just file name.

2 replies

24-Ruby III
January 11, 2022

Hi,

please ask PTC Support.

24-Ruby III
January 11, 2022
sjuraj15-MoonstoneAnswer
15-Moonstone
January 12, 2022

When you have something selected it is in SelectionBuffer so you can retrieve anything you like from it. If you have selected component you can directly access whole model not just file name.

akok12-AmethystAuthor
12-Amethyst
January 12, 2022

Thank you, it seems to by a step forward.

I can get the buffer, but a can't the part info, I have tried this:

Session session = pfcGlobal.GetProESession();
SelectionBuffer selection = session.GetCurrentSelectionBuffer();
Selections selections = selection.GetContents();

 

But I can't anything out of selections. The only thing I need is the file name.

 

Allan

15-Moonstone
January 13, 2022

You can have multiple items (seledted models) at same time .. to get first model in selection you do this

session.GetCurrentSelectionBuffer().GetContents().get(0).GetSelModel();

Or you can loop through all models in buffer