Solved

HOW TO GET MENUITEM TAGSTRING OR LABLE OF CLICKED MENUITEM USING VBA/LISP

Posted on 2004-09-30
4
298 Views
Last Modified: 2008-02-01
running autocad map 5, this what I'm trying to do. I have several saved queries that I am running from a dropdown menu in a some what clunky way, got an idea to change it but am stumped.
I want to be able to click on the menu item and have it run a single dvb project (the same one for all) that gets the tagstring of the selected menuitem then runs the query using the 'case' method based on that tag string.
Right now I've got a seperate sub for each menuitem that uses a function call to the query function, and they are filling up my macro manager.
Is it even possible to get the tagstring of the clicked menuitems/toolbar items? I think this might be a good way to do a block insert toolbar also.
Thanks for any help, I've been stumped for 2 days.
willing to use lisp or a combo of the 2 if I have too....
0
Comment
Question by:norrin_radd
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
david_barker earned 250 total points
ID: 12212634
One (of many possible) solutions, trying to avoid AutoLISP, except just for the SETVAR (but could of done it without) :

The pop-up menu :

***POP13
**TEST
M_test  [&My test]
M_act_1 [Action &1]^C^C(setvar "USERI1" 1) -EXECVBA "c:/temp/MyProjet.dvb!MyModule.Hello"
M_act_2 [Action &2]^C^C(setvar "USERI1" 2) -EXECVBA "c:/temp/MyProjet.dvb!MyModule.Hello"
M_act_3 [Action &3]^C^C(setvar "USERI1" 3) -EXECVBA "c:/temp/MyProjet.dvb!MyModule.Hello"

The VBA code :

Public Sub Hello()
  MsgBox ThisDrawing.GetVariable("USERI1")
End Sub

This assumes that the system variable USERI1 isn't used elsewhere in your application.
0
 
LVL 10

Author Comment

by:norrin_radd
ID: 12217856
man I forgot about the useri variables thanks I think that will work good. just out of curiousity how would you have done it without those? and I'm guessing but it doesnt look like there is a way to get the tagstring of a clicked menuitem?
thanks again
0
 
LVL 6

Expert Comment

by:david_barker
ID: 12217991
I could of used a shared variable between Visual Lisp and VBA, but that would of got somewhat complicated.
Or perhaps I would of used the BeginCommand event.
Or, to be honest, by doing everything in plain old AutoLisp, ie.
  M_act_1 [Action &1]^C^C(hello 1)
where "hello" is my AutoLisp funtion.
0
 
LVL 10

Author Comment

by:norrin_radd
ID: 12218492
good points thanks,
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AutoDesk LT 2014 2 1,609
Contractor and software licenses? 6 240
autocad 2013,2014,2015 1 70
visio file 1 79
Following a number of instances of re-installing Solidworks I thought that it may be a  good idea to detail the procedure that I follow each time to ensure a good stable install. Backup: Backup your system.  It goes without saying that this i…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now