Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-09-30
4
Medium Priority
?
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
david_barker earned 1000 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Our company has proprietary drawing files that we do not give to our customers for final documentation. Our customers now require that we give them these drawings. They understand that they are proprietary and do not require them to be in AutoCAD bu…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

705 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