Solved

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

Posted on 2004-09-30
4
303 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unable to get plugins to work in AutoCAD 2013 LT 13 2,826
Contractor and software licenses? 6 252
Microsoft Server 2012 R2 with DFS and AutoCAD 7 327
put 2 scans over each other 17 184
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…
If, like me, you find yourself repeatedly and tediously joining many segments (lines, arcs) in other people's drawings back into polylines that can be used more effectively in Computer Aided Machining and Laser Cutting, then this article is for you!…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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