<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Get Document Object from Context Menu? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-get-document-object-from-context-menu/m-p/13266247#M2860</link>
    <description>&lt;P&gt;Wow I had no clue you could add your own context menu items!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't code in VBA and I'm&amp;nbsp;&lt;EM&gt;guessing&amp;nbsp;&lt;/EM&gt;based on how I think this action would go. I only see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;UserInputEvents.OnLinearMarkingMenu( SelectedEntities As ObjectsEnumerator, SelectionDevice As SelectionDeviceEnum, LinearMenu As CommandControls, AdditionalInfo As NameValueMap )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You would be looking for an event that had "SelectedEntities as ObjectEnumerator" in it. If you have that firing correctly and its getting one object, I assume that it will be a &lt;SPAN&gt;kBrowserNodeObject. You can get the object with &lt;EM&gt;.NativeObject&lt;/EM&gt;. This will get the componentoccurrence you selected.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;You should definitely post the whole code though.&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jan 2025 01:48:45 GMT</pubDate>
    <dc:creator>C_Haines_ENG</dc:creator>
    <dc:date>2025-01-17T01:48:45Z</dc:date>
    <item>
      <title>How to Get Document Object from Context Menu?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-get-document-object-from-context-menu/m-p/13265944#M2859</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Does anyone know a way to get the selected Document object from the Browser in a OnContextMenu event?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_3368dd84.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1455841iA3649F7B9D278220/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_3368dd84.png" alt="Snag_3368dd84.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I made a custom context menu button, but I can't figure out how to get the selected Document object from the context menu user event&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private void UserInputEvents_OnContextMenu(SelectionDeviceEnum SelectionDevice, NameValueMap AdditionalInfo, CommandBar CommandBar)
{ ...}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;or from the button click event&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; private void CCIFSInfoRightClick_OnExecute(NameValueMap Context)
 {...}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Anyone have any insights or ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2025 21:34:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-get-document-object-from-context-menu/m-p/13265944#M2859</guid>
      <dc:creator>mfoster9TD82</dc:creator>
      <dc:date>2025-01-16T21:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get Document Object from Context Menu?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-get-document-object-from-context-menu/m-p/13266247#M2860</link>
      <description>&lt;P&gt;Wow I had no clue you could add your own context menu items!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't code in VBA and I'm&amp;nbsp;&lt;EM&gt;guessing&amp;nbsp;&lt;/EM&gt;based on how I think this action would go. I only see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;UserInputEvents.OnLinearMarkingMenu( SelectedEntities As ObjectsEnumerator, SelectionDevice As SelectionDeviceEnum, LinearMenu As CommandControls, AdditionalInfo As NameValueMap )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You would be looking for an event that had "SelectedEntities as ObjectEnumerator" in it. If you have that firing correctly and its getting one object, I assume that it will be a &lt;SPAN&gt;kBrowserNodeObject. You can get the object with &lt;EM&gt;.NativeObject&lt;/EM&gt;. This will get the componentoccurrence you selected.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;You should definitely post the whole code though.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 01:48:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-get-document-object-from-context-menu/m-p/13266247#M2860</guid>
      <dc:creator>C_Haines_ENG</dc:creator>
      <dc:date>2025-01-17T01:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get Document Object from Context Menu?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-get-document-object-from-context-menu/m-p/13267779#M2861</link>
      <description>&lt;P&gt;Good find! I was using UserInputEvents.OnContextMenu which doesn't look like it is in the API documentation anymore...&lt;BR /&gt;I figured out a way to do it with OnContextMenu, you can just look at&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;InventoInventorApplication.ActiveDocument.SelectSetrApplication.ActiveDocument.SelectSet&lt;/LI-CODE&gt;&lt;P&gt;But I think the OnLinearMarkingMenu is probably the more supported method so I'll probably switch to using that, It looks like they do about the same thing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 16:37:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-get-document-object-from-context-menu/m-p/13267779#M2861</guid>
      <dc:creator>mfoster9TD82</dc:creator>
      <dc:date>2025-01-17T16:37:34Z</dc:date>
    </item>
  </channel>
</rss>

