Visual LISP, AutoLISP and General Customization

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

MENUCMD problem with pulldowns

348 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))

 

Distinguished Contributor
Jedimaster
Posts: 146
Registered: ‎03-11-2009
Message 2 of 2 (320 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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community