Unable to add menu pulldown at end

Unable to add menu pulldown at end

iwafb
Advisor Advisor
782 Views
3 Replies
Message 1 of 4

Unable to add menu pulldown at end

iwafb
Advisor
Advisor

HI All,

 

I'm trying to display a pulldown menu at the end of the autocad pulldowns (after the help pulldown menu). The new menu comes from a partial custom menu I created. I had done this in previous versions, but doesn't want to play now...

 

I'm checking the last pulldown menu index using:

 

(setq nextpop (rtos (vla-get-count (vla-get-menubar (vlax-get-acad-object))) 2 0))

 

If I then try the following to add the custom pulldown at the next available position, it doesn't work:

 

(menucmd (strcat "P" (rtos (+ 1 (read nextpop)) 2 0) "=Custom.POP15"))

 

However, I can use the following and the pulldown loads where the help menu used to be:

 

(menucmd (strcat "P" nextpop "=Custom.POP15"))

 

Using Advance Steel 2018...

 

Thanks in advance.

Dart

 

 

0 Likes
783 Views
3 Replies
Replies (3)
Message 2 of 4

scot-65
Advisor
Advisor
Perhaps
(setq nextpop (rtos (vla-get-count (vla-get-menubar (vlax-get-acad-object))) 2 0))
...
(rtos (+ 1 (read nextpop)) 2 0)

to

(setq nextpop (vla-get-count (vla-get-menubar (vlax-get-acad-object))))
...
(itoa (1+ nextpop))

Apply the conversion at the value's call.

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 3 of 4

iwafb
Advisor
Advisor

Thanks Scot,

 

Still the same. I don't think it the value, for some reason, Advance Steel is happy to add if it overwrites one of the current pulldowns, but not at the end (adding new pulldown).

 

I am finding lots of unexpected problems with Advance steel and lisp. Not sure if it's due AS working slightly different to Autocad and maybe the lisp api  is not 100%. That's what I'm putting it down to...

 

Forcing the pulldowns from the current profile (CUI) and it seems to be a good workaround...

 

Cheers.

Dart

0 Likes
Message 4 of 4

scot-65
Advisor
Advisor
Perhaps try this direction?
vla-InsertMenuInMenuBar
https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-ActiveX/files...
It is giving hint to turn off the menubar, add the item, and turn back on?

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes