Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add-In: Determine right-clicked row in Parts List

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
DRoam
535 Views, 7 Replies

Add-In: Determine right-clicked row in Parts List

I have an add-in that's watching for right-clicks on Parts Lists in drawings. I'm able to watch for that event with this:

 

Sub OnPartsListRMB(SelectedEntities As ObjectsEnumerator, SelectionDevice As SelectionDeviceEnum, LinearMenu As CommandControls, AdditionalInfo As NameValueMap) Handles UserInputEvents.OnLinearMarkingMenu
    If SelectedEntities.Count = 1 AndAlso TypeOf SelectedEntities(1) Is PartsList Then
        MsgBox("Parts List right-clicked!")
    End If
End Sub

However, what I actually want is to determine the document associated with the specific row that was right-clicked.

 

When we right-click a row, there's an "Open" button that will open the document associated with the row. So that information must be available under the hood somewhere.

 

Is that information (the specific row/document clicked) accessible via the OnLinearMarkingMenu event, or some other API?

7 REPLIES 7
Message 2 of 8
DRoam
in reply to: DRoam

Any ideas, anyone? @MjDeck, do you know if this is possible via the API?

Message 3 of 8
jjstr8
in reply to: DRoam

The OnLinearMarkingMenu event is just indicating that you right-clicked (somewhere) with one or more entities selected.  The parts list is a single entity as far as the event is concerned.  I'm not even sure there's a hack that would let you translate the cursor position to an item in the parts list.  You would have to know how Inventor is graphically laying out the parts list.

Message 4 of 8
DRoam
in reply to: jjstr8

That's what I figured. The OnLinearMarkingMenu event probably isn't going to have what I need.

 

But Inventor itself somehow knows which row was clicked (in order for the "Open" function to work). I'm wondering if there's some API that exposes that...

Message 5 of 8
jjstr8
in reply to: DRoam

The "AdditionalInfo" NameValueMap parameter in the OnLinearMarkingMenu event is currently unused (at least in my 2017 version).  Maybe post a suggestion in the Inventor Ideas forums to have information about the parts list row passed along to the event handler.  As you pointed out, Inventor clearly knows which row of the parts list you right-clicked on.  It wouldn't be a stretch for Inventor to pass along something to identify the row.

Message 6 of 8
DRoam
in reply to: jjstr8

The AdditionalInfo parameter would be a good place to pass along the selected row, good idea. I'll wait a bit more to see if someone knows of a solution that would work now. But if there isn't one (which is looking likely), I'll create an idea for that.

Message 7 of 8
MjDeck
in reply to: DRoam

@DRoam , it looks like there's no way to get the row. It's not really "selected", although the system does know that the mouse is over it. The whole parts list is what's selected. Please post an Idea.


Mike Deck
Software Developer
Autodesk, Inc.

Message 8 of 8
DRoam
in reply to: MjDeck

Thanks Mike. Since this is not currently possible, idea created here: Provide API access to which Parts List row was right-clicked.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report