Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
Jedimaster
Posts: 162
Registered: ‎03-11-2009
Message 1 of 2 (363 Views)
Accepted Solution

MENUCMD problem with pulldowns

363 Views, 1 Replies
03-21-2012 09:41 AM

This has been a issue for quite a few years. The raster image pulldown disappears. The cui is still loaded but the Image tab does not show up in the menubar. The following routine loads the Raster menu is not loaded. Then looks at the menubar to see if the image tab shows up. If it does not see the image tab it will try to load it with the MENUCMD. Basically (menucmd "p14=+AeciIbUi.pop7"). However, nothing pops up. I can get this to work with other tabs just not image.

 

 

(vl-load-com)
;;Check operating system
(if (vl-string-search "x86" (vla-get-path (vlax-get-acad-object)))
	(setq ProductKey (vl-string-subst "SOFTWARE\\Wow6432Node" "SOFTWARE" (strcase (vlax-product-key))))
	(setq ProductKey (vlax-product-key))
)
;;Find menufile load once found
(setq RasterLocation(vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" ProductKey "\\Add-Ons\\RasterDesign") "Location"))
(if RasterLocation
	(progn
		(setq RasterMenu (findfile (strcat RasterLocation "UserDataCache\\Support\\AecCo.cui")))
		(if (not RasterMenu)(setq RasterMenu (findfile (strcat RasterLocation "UserDataCache\\Support\\AecCo.cuix"))))
		(if (not RasterMenu)(progn (princ "\nNo Menu Found!\n")(exit)))
		(if (and (not (menugroup "RASTERDESIGN"))(not (menugroup "AUTOCADRASTERDESIGN")))(command "MENULOAD" RasterMenu))
		
	)
)
;;Check menubar
(setq barlist nil)
(vlax-for n (vla-get-MenuBar (vlax-get-acad-object)) (setq barlist (append barlist (list (strcase (vla-get-NameNoMnemonic n))) )))
;;Show Image tab
(setq ccmd (strcat "p" (itoa (+ (length barlist) 1)) "=+AeciIbUi.pop7"))
(if (and (or (menugroup "RASTERDESIGN")(menugroup "AUTOCADRASTERDESIGN"))(not (member "IMAGE" barlist)))(menucmd ccmd))

 

Problem solved

(menucmd (strcat "p" (itoa (+ (vla-get-count (vla-get-MenuBar (vlax-get-acad-object))) 1)) "=+AUTOCADRASTERDESIGN.pop7"))

instead of

(menucmd (strcat "p" (itoa (+ (vla-get-count (vla-get-MenuBar (vlax-get-acad-object))) 1))  "=+AeciIbUi.pop7"))

evidently it is looking for menugroup on file name.

Distinguished Contributor
Jedimaster
Posts: 162
Registered: ‎03-11-2009
Message 2 of 2 (335 Views)

Re: MENUCMD problem with pulldowns

03-26-2012 12:00 PM in reply to: Jedimaster

Problem solved

(menucmd (strcat "p" (itoa (+ (vla-get-count (vla-get-MenuBar (vlax-get-acad-object))) 1)) "=+AUTOCADRASTERDESIGN.pop7"))

instead of

(menucmd (strcat "p" (itoa (+ (vla-get-count (vla-get-MenuBar (vlax-get-acad-object))) 1))  "=+AeciIbUi.pop7"))

evidently it is looking for menugroup on file name.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.