Right click menu syntax

Right click menu syntax

Anonymous
Not applicable
346 Views
2 Replies
Message 1 of 3

Right click menu syntax

Anonymous
Not applicable
I've got a VB Function that takes an Autocad entity as an argument. Is
there anyway to pass a selected (gripped) object to that function out
of a right-click menu?

Thanks
0 Likes
347 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Can try this and see if this is close to your requirement?


Private Sub AcadDocument_BeginShortcutMenuEdit(ShortcutMenu As
IAcadPopupMenu, SelectionSet As IAcadSelectionSet)

If ShortcutMenu.Item(0).Label <> "Test" Then
ShortcutMenu.AddMenuItem 0, "Test", Chr(3) & Chr(3) & "(vl-load-com)" &
Chr(32) & "(vla-runmacro (vlax-get-acad-object) ""ftest"")" & Chr(32)
End If

End Sub

Sub fTest()
MsgBox ThisDrawing.PickfirstSelectionSet.Item(0).Handle
End Sub


Cheers,
Murali

"Bill" wrote in message
news:erpgttgas82b67indjn3nae46cfc0ls8ml@4ax.com...
> I've got a VB Function that takes an Autocad entity as an argument. Is
> there anyway to pass a selected (gripped) object to that function out
> of a right-click menu?
>
> Thanks
0 Likes
Message 3 of 3

Anonymous
Not applicable
Worked like a charm. Thanks for the second time.

Bill

>Can try this and see if this is close to your requirement?
>
>
>Private Sub AcadDocument_BeginShortcutMenuEdit(ShortcutMenu As
>IAcadPopupMenu, SelectionSet As IAcadSelectionSet)
>
>If ShortcutMenu.Item(0).Label <> "Test" Then
> ShortcutMenu.AddMenuItem 0, "Test", Chr(3) & Chr(3) & "(vl-load-com)" &
>Chr(32) & "(vla-runmacro (vlax-get-acad-object) ""ftest"")" & Chr(32)
>End If
>
>End Sub
>
>Sub fTest()
>MsgBox ThisDrawing.PickfirstSelectionSet.Item(0).Handle
>End Sub
>
>
>Cheers,
>Murali
>
>"Bill" wrote in message
>news:erpgttgas82b67indjn3nae46cfc0ls8ml@4ax.com...
>> I've got a VB Function that takes an Autocad entity as an argument. Is
>> there anyway to pass a selected (gripped) object to that function out
>> of a right-click menu?
>>
>> Thanks
>
>
0 Likes